diff options
author | Werner Koch <wk@gnupg.org> | 2011-02-04 20:21:45 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2011-02-04 20:21:45 +0100 |
commit | 4f048514ecae879fa4bb7b8522baf801229be522 (patch) | |
tree | d798c8527b68e83e4419c14d7c6dd47f2abdfd9e /doc/HACKING | |
parent | 9d00b28e0d04361fe9ccf02983bea781b5701c1d (diff) | |
download | libgcrypt-4f048514ecae879fa4bb7b8522baf801229be522.tar.gz |
Nuked almost all trailing whitespace.post-nuke-of-trailing-ws
Check and install the standard git pre-commit hook.
Diffstat (limited to 'doc/HACKING')
-rw-r--r-- | doc/HACKING | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/doc/HACKING b/doc/HACKING index 51380b17..3f94772c 100644 --- a/doc/HACKING +++ b/doc/HACKING @@ -29,38 +29,37 @@ Debugging math stuff: ===8<======== hextodec(s)=local(v=Vec(s),a=10,b=11,c=12,d=13,e=14,f=15,A=10,B=11,C=12,D=13,E=14,F=15,h);if(#setunion(Set(v),Vec("0123456789ABCDEFabcdef"))>22,error);for(i=1,#v,h=shift(h,4)+eval(v[i]));h - + p = hextodec("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF") a = hextodec("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC") b = hextodec("51953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00") - + /* Set up y^2 = x^3 + ax + b mod (p). */ e = ellinit(Mod(1,p)*[0,0,0,a,b]); - + gx = hextodec ("00C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66") gy = hextodec ("011839296A789A3BC0045C8A5FB42C7D1BD998F54449579B446817AFBD17273E662C97EE72995EF42640C550B9013FAD0761353C7086A272C24088BE94769FD16650") g = Mod(1,p)*[gx,gy] - + n = hextodec ("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409") - + /* Verify that G is on the curve, and that n is the order. */ ellisoncurve (e,g) isprime (n) ellpow (e,g,n) - + d = hextodec ("018F9573F25059571BDF614529953DE2540497CEDABD04F3AF78813BED7BB163A2FD919EECF822848FCA39EF55E500F8CE861C7D53D371857F7774B79428E887F81B") - + qx = hextodec ("00316AAAD3E905875938F588BD9E8A4785EF9BDB76D62A83A5340F82CB8E800B25619F5C3EA02B7A4FA43D7497C7702F7DFBEAC8E8F92C3CAABD9F84182FDA391B3B") /* Note: WRONG! (It is apparent that this is the same as X shifted by 8 bit). */ qy = hextodec ("0000316AAAD3E905875938F588BD9E8A4785EF9BDB76D62A83A5340F82CB8E800B25619F5C3EA02B7A4FA43D7497C7702F7DFBEAC8E8F92C3CAABD9F84182FDA391B") q = Mod(1,p)*[qx,qy] - + /* Calculate what Q should be given d. */ ellpow (e,g,d) - + /* This is not 0 and thus shows that libgcrypt gave Q and d that do not match. */ ellpow (e,g,d) - q ====8<===================== - |