diff options
Diffstat (limited to 'libraries/spongycastle/core/src/test/java/org/spongycastle/pqc/math/ntru/euclid/test/BigIntEuclideanTest.java')
-rw-r--r-- | libraries/spongycastle/core/src/test/java/org/spongycastle/pqc/math/ntru/euclid/test/BigIntEuclideanTest.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libraries/spongycastle/core/src/test/java/org/spongycastle/pqc/math/ntru/euclid/test/BigIntEuclideanTest.java b/libraries/spongycastle/core/src/test/java/org/spongycastle/pqc/math/ntru/euclid/test/BigIntEuclideanTest.java new file mode 100644 index 000000000..5078090a0 --- /dev/null +++ b/libraries/spongycastle/core/src/test/java/org/spongycastle/pqc/math/ntru/euclid/test/BigIntEuclideanTest.java @@ -0,0 +1,23 @@ +package org.spongycastle.pqc.math.ntru.euclid.test; + +import java.math.BigInteger; + +import junit.framework.TestCase; +import org.spongycastle.pqc.math.ntru.euclid.BigIntEuclidean; + +public class BigIntEuclideanTest + extends TestCase +{ + public void testCalculate() + { + BigIntEuclidean r = BigIntEuclidean.calculate(BigInteger.valueOf(120), BigInteger.valueOf(23)); + assertEquals(BigInteger.valueOf(-9), r.x); + assertEquals(BigInteger.valueOf(47), r.y); + assertEquals(BigInteger.valueOf(1), r.gcd); + + r = BigIntEuclidean.calculate(BigInteger.valueOf(126), BigInteger.valueOf(231)); + assertEquals(BigInteger.valueOf(2), r.x); + assertEquals(BigInteger.valueOf(-1), r.y); + assertEquals(BigInteger.valueOf(21), r.gcd); + } +}
\ No newline at end of file |