shithub: mc

Download patch

ref: 85e3adbca63041d3628e9f8d55d83aa34d084008
parent: 32fd9ebd1835ebb788ddf8555dab777e32ee3f97
author: Ori Bernstein <ori@eigenstate.org>
date: Sat Apr 7 21:45:35 EDT 2018

Add a nontrivial modpow test.

--- a/lib/crypto/test/ctbig.myr
+++ b/lib/crypto/test/ctbig.myr
@@ -114,7 +114,7 @@
 		//		"392318858376010676506814412592879878824393346033951606800",
 		//		"5192296858534810493479828944327220")
 		//}],
-		[.name="modpow", .fn={ctx
+		[.name="modpow-nop", .fn={ctx
 			do3(ctx, crypto.ctmodpow, Nbit,
 				"1231231254019581241243091223098123",
 				"1231231254019581241243091223098123",
@@ -121,7 +121,13 @@
 				"1",
 				"238513807008428752753137056878245001837")
 		}],
-
+		[.name="modpow", .fn={ctx
+			do3(ctx, crypto.ctmodpow, Nbit,
+				"134487661739548107356399382114451163287",
+				"1231231254019581241243091223098123",
+				"312312091230",
+				"238513807008428752753137056878245001837")
+		}],
 	][:])
 }