aboutsummaryrefslogtreecommitdiff
path: root/test/test_e12.ml
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_e12.ml')
-rw-r--r--test/test_e12.ml35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/test_e12.ml b/test/test_e12.ml
index 6be08a8..8c76bc6 100644
--- a/test/test_e12.ml
+++ b/test/test_e12.ml
@@ -156,6 +156,40 @@ let test_add () =
"0";
|] )))
+let test_double () =
+ let a =
+ f
+ ( [|
+ "0";
+ "0";
+ "0";
+ "0";
+ "864680025495851032298585449242495442172586480369653270569427520081920647109443766686964546009031896772231151484739";
+ "0";
+ "0";
+ "0";
+ "0";
+ "0";
+ "1631392878509829468330827308350745651550160006042966046936061802639012597909369897842804975745918562123972568708986";
+ "0";
+ |],
+ [|
+ "0";
+ "0";
+ "0";
+ "3175875744091331376881702916348722059990202461121243501806124053462822942076308690447194451748015149897939410507835";
+ "0";
+ "0";
+ "0";
+ "0";
+ "0";
+ "1261674949629831053147743653050474475817726050930614703730644111735569882980952175496663479511045926628196951977486";
+ "0";
+ "0";
+ |] )
+ in
+ Alcotest.(check e12) "equals" (E12.add a a) (E12.double a)
+
let test_sub () =
Alcotest.(check e12)
"equals"
@@ -448,6 +482,7 @@ let tests =
test_case "Is On Curve" `Quick test_curve;
test_case "Is In Canonical Subgroup" `Quick test_subgroup;
test_case "Addition" `Quick test_add;
+ test_case "Double" `Quick test_double;
test_case "Subtraction" `Quick test_sub;
test_case "Scalar Multiplication" `Quick test_scalar_mul;
test_case "Additive Inverse" `Quick test_neg;