aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/data
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-02-23 07:13:31 -0500
committerJack Lloyd <[email protected]>2018-02-23 07:13:31 -0500
commit971749b8486e4a17eba54c32a8fdff942eb37af2 (patch)
treec7a325814c8a7ceb861284acaffdb1e62d4a9bc0 /src/tests/data
parent1152261ca45a55f368ea31aa9a5eb89d9c35abc4 (diff)
Fix an error in BigInt operator-
(x) - (-x) would result in -2x instead of the correct 2x
Diffstat (limited to 'src/tests/data')
-rw-r--r--src/tests/data/bn/add.vec26
-rw-r--r--src/tests/data/bn/sub.vec38
2 files changed, 58 insertions, 6 deletions
diff --git a/src/tests/data/bn/add.vec b/src/tests/data/bn/add.vec
index d7fb72d57..4829e1706 100644
--- a/src/tests/data/bn/add.vec
+++ b/src/tests/data/bn/add.vec
@@ -15,9 +15,29 @@ In1 = 0x1
In2 = 0x1
Output = 0x2
-In1 = 0x1
-In2 = -0x1
-Output = 0x0
+In1 = 1
+In2 = -1
+Output = 0
+
+In1 = -1
+In2 = 1
+Output = 0
+
+In1 = -1
+In2 = -1
+Output = -2
+
+In1 = 1
+In2 = -2
+Output = -1
+
+In1 = -2
+In2 = 1
+Output = -1
+
+In1 = -2
+In2 = -1
+Output = -3
In1 = 0x5
In2 = 0x0
diff --git a/src/tests/data/bn/sub.vec b/src/tests/data/bn/sub.vec
index 5b649ef87..a3cac4206 100644
--- a/src/tests/data/bn/sub.vec
+++ b/src/tests/data/bn/sub.vec
@@ -7,9 +7,41 @@ In1 = 0x0
In2 = 0x1
Output = -0x1
-In1 = 0x1
-In2 = -0x1
-Output = 0x2
+In1 = 1
+In2 = -1
+Output = 2
+
+In1 = -1
+In2 = 1
+Output = -2
+
+In1 = -1
+In2 = -1
+Output = 0
+
+In1 = 1
+In2 = 1
+Output = 0
+
+In1 = 1
+In2 = -1
+Output = 2
+
+In1 = 1
+In2 = -2
+Output = 3
+
+In1 = -1
+In2 = 2
+Output = -3
+
+In1 = -3
+In2 = -1
+Output = -2
+
+In1 = -3
+In2 = 1
+Output = -4
In1 = 0x64
In2 = -0x64