# Test vectors for Barrett modular reduction
#
-# $Id: mpbarrett,v 1.4 2004/04/01 12:50:41 mdw Exp $
+# $Id$
mpbarrett-reduce {
17 11 6;
# --- Negative exponents ---
+ 0xfffffffdffffffffffffffffffffffff 0xfffffffdfffffffffffffffffffffffe 0 1;
8939489893434234331 1804289383 -8939035539979879765 6139425926295484741;
# --- DSA public key derivation ---
0xdde5808744e1cd37c88667e7033694b2513a7429f035f11c0bafc4dff2b96a672bd0a3ca16aba2ea526df00c8571106ba4a1d83eb62605fc9274ab70bef0a111cd070cca2d8b10edf042d6c44f863c36fabea8bb0d7340eb8c169da27a4b0ba2713c166152a0244235093391c5f71aee8c03dcaf2335a2e4689ccb27ba365ec7
0x65985e4c2d6027a8afdeb9b44cc619e1c4d46bde873e0d4b45325412a2f8365e51245324f888704295fe8233a6666624d9a4701172dbfcab5c9643e1caab79eb2a0c85284d1b858688b8f16804326321f53a723502a6d6ae08dcbffccf2187a799f6281c2478ef0faed5c5c80adeabc5ee435cff8b9ae0b603e47fb08d73b014
0x23a252f60bae4907a8ed5b6203e2b1da32848cd9
- 0x9720498d8ec1208585635faaf952c1204c37119acccc64ed7942867be24770e33db39ffcfa1194549ead8495a7918a20e15144e68125860ef4f8c1a3d771bad690938bdb2c8817e2b89a8fc615d067084a7a2f2f9280e15fb9ccebfe713584260d5ed30545b69745d7b22977bfd44d60d7c5e657aab1c79dc5cb33ff29ee9074;
+ 0x9720498d8ec1208585635faaf952c1204c37119acccc64ed7942867be24770e33db39ffcfa1194549ead8495a7918a20e15144e68125860ef4f8c1a3d771bad690938bdb2c8817e2b89a8fc615d067084a7a2f2f9280e15fb9ccebfe713584260d5ed30545b69745d7b22977bfd44d60d7c5e657aab1c79dc5cb33ff29ee9074;
# --- Quick RSA test ---
- 905609324890967090294090970600361 # This is p
+ 905609324890967090294090970600361 # This is p
3
- 905609324890967090294090970600360 # This is (p - 1)
- 1; # Fermat test: p is prime
+ 905609324890967090294090970600360 # This is (p - 1)
+ 1; # Fermat test: p is prime
- 734589569806680985408670989082927 # This is q
+ 734589569806680985408670989082927 # This is q
5
- 734589569806680985408670989082926 # And this is (q - 1)
- 1; # Fermat again: q is prime
+ 734589569806680985408670989082926 # And this is (q - 1)
+ 1; # Fermat again: q is prime
# --- Encrypt a message ---
#
5945908509680983480596809586040589085680968709809890671
25906467774034212974484417859588980567136610347807401817990462701;
- # --- And decrypt it again ---
+ # --- And decrypt it again ---
665251164384574309450646977867045404520085938543622535546005136647
25906467774034212974484417859588980567136610347807401817990462701
514778499400157641662814932021958856708417966520837469125919104431
123456789012345678901234567890123456789012345678901234567890;
+
+ # --- Strange bug ---
+ #
+ # Strange memory corruption bug causing mpbarrett_reduce to hang.
+ # Seems to have vanished on a clean rebuild so maybe this was just build
+ # fluff or something. Leave it here to pick up regression.
+
+ 30916300184138066757562815127455898754391418637651479989257882011612153138316483396290143656363307389355307404813205623380378799585065876990874918745873480056891738964426752
+ 2 44329
+ 10975270953088118598390528358454369816072092233138947812823085741431681835772475760228604878294514156761050649439713085882651077696501584961485141097470430535290622475239424;
}
# --- Simultaneous exponentiation ---