From 16cda542f360196b63bb59d2943ba62a3466df64 Mon Sep 17 00:00:00 2001 From: Simon Guggi Date: Thu, 24 Feb 2022 13:18:55 +0100 Subject: [PATCH] fixed errors --- .../numeric/field/MersennePrimeFieldDefinitionTest.java | 4 ++-- .../tools/bitTriples/BitTripleResourcePoolImpl.java | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/src/test/java/dk/alexandra/fresco/framework/builder/numeric/field/MersennePrimeFieldDefinitionTest.java b/core/src/test/java/dk/alexandra/fresco/framework/builder/numeric/field/MersennePrimeFieldDefinitionTest.java index 34c6350f6..54cca5207 100644 --- a/core/src/test/java/dk/alexandra/fresco/framework/builder/numeric/field/MersennePrimeFieldDefinitionTest.java +++ b/core/src/test/java/dk/alexandra/fresco/framework/builder/numeric/field/MersennePrimeFieldDefinitionTest.java @@ -26,13 +26,13 @@ public void largeConstant() { @Test public void createElement() { Long baseNumber = 2L; - MersennePrimeFieldDefinition fieldDefintion = new MersennePrimeFieldDefinition(4, 2); + MersennePrimeFieldDefinition fieldDefintion = new MersennePrimeFieldDefinition(128,173); MersennePrimeFieldElement elementFromString = (MersennePrimeFieldElement) fieldDefintion.createElement(baseNumber.toString()); MersennePrimeFieldElement elementFromLong = (MersennePrimeFieldElement) fieldDefintion.createElement(baseNumber); MersennePrimeFieldElement elementFromBigInt = (MersennePrimeFieldElement) fieldDefintion.createElement(new BigInteger(baseNumber.toString())); MersennePrimeFieldElement result = (MersennePrimeFieldElement) elementFromLong.multiply(elementFromString).multiply(elementFromBigInt); - Assert.assertThat(MersennePrimeFieldElement.extractValue(result).longValue(), Is.is(baseNumber*baseNumber*baseNumber)); + Assert.assertTrue(result.toBigInteger().longValue() ==baseNumber*baseNumber*baseNumber); } diff --git a/tools/bitTriples/src/main/java/dk/alexandra/fresco/tools/bitTriples/BitTripleResourcePoolImpl.java b/tools/bitTriples/src/main/java/dk/alexandra/fresco/tools/bitTriples/BitTripleResourcePoolImpl.java index 5a2494952..65e4d7ad2 100644 --- a/tools/bitTriples/src/main/java/dk/alexandra/fresco/tools/bitTriples/BitTripleResourcePoolImpl.java +++ b/tools/bitTriples/src/main/java/dk/alexandra/fresco/tools/bitTriples/BitTripleResourcePoolImpl.java @@ -8,8 +8,8 @@ import dk.alexandra.fresco.tools.bitTriples.prg.BytePrg; import dk.alexandra.fresco.tools.bitTriples.prg.BytePrgImpl; import dk.alexandra.fresco.tools.cointossing.CoinTossing; -import dk.alexandra.fresco.tools.ot.base.DhParameters; -import dk.alexandra.fresco.tools.ot.base.NaorPinkasOt; +import dk.alexandra.fresco.tools.ot.base.AbstractNaorPinkasOT; +import dk.alexandra.fresco.tools.ot.base.BigIntNaorPinkas; import dk.alexandra.fresco.tools.ot.otextension.CoteFactory; import dk.alexandra.fresco.tools.ot.otextension.OtExtensionResourcePool; import dk.alexandra.fresco.tools.ot.otextension.OtExtensionResourcePoolImpl; @@ -79,8 +79,8 @@ public CoteFactory createCote(int otherId, Network network, StrictBitVector choi } CoinTossing ct = new CoinTossing(getMyId(), otherId, getRandomGenerator()); ct.initialize(network); - NaorPinkasOt ot = - new NaorPinkasOt(otherId, getRandomGenerator(), network, DhParameters.getStaticDhParams()); + AbstractNaorPinkasOT ot = + new BigIntNaorPinkas(otherId, getRandomGenerator(), network); RotList currentSeedOts = new RotList(drbg, choices.getSize(), choices); if (getMyId() < otherId) { currentSeedOts.send(ot);