Skip to content

Commit

Permalink
fixed errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Guggi committed Feb 24, 2022
1 parent 9ee4069 commit 16cda54
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 16cda54

Please sign in to comment.