diff options
author | rsc <devnull@localhost> | 2006-04-01 19:24:03 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2006-04-01 19:24:03 +0000 |
commit | cbeb0b26e4c7caa8d1b47de791a7418dc20a4567 (patch) | |
tree | e0f7e445de1aa22a42ef873dc4b1118a8105ae93 /src/libsec/port/rsadecrypt.c | |
parent | 226d80b8213821af0cbf092d1507c52b504fd368 (diff) | |
download | plan9port-cbeb0b26e4c7caa8d1b47de791a7418dc20a4567.tar.gz plan9port-cbeb0b26e4c7caa8d1b47de791a7418dc20a4567.tar.bz2 plan9port-cbeb0b26e4c7caa8d1b47de791a7418dc20a4567.zip |
Use gcc -ansi -pedantic in 9c. Fix many non-C89-isms.
Diffstat (limited to 'src/libsec/port/rsadecrypt.c')
-rw-r--r-- | src/libsec/port/rsadecrypt.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libsec/port/rsadecrypt.c b/src/libsec/port/rsadecrypt.c index 1e937bec..82e2eeea 100644 --- a/src/libsec/port/rsadecrypt.c +++ b/src/libsec/port/rsadecrypt.c @@ -2,9 +2,9 @@ #include <mp.h> #include <libsec.h> -// decrypt rsa using garner's algorithm for the chinese remainder theorem -// seminumerical algorithms, knuth, pp 253-254 -// applied cryptography, menezes et al, pg 612 +/* decrypt rsa using garner's algorithm for the chinese remainder theorem */ +/* seminumerical algorithms, knuth, pp 253-254 */ +/* applied cryptography, menezes et al, pg 612 */ mpint* rsadecrypt(RSApriv *rsa, mpint *in, mpint *out) { @@ -13,17 +13,17 @@ rsadecrypt(RSApriv *rsa, mpint *in, mpint *out) if(out == nil) out = mpnew(0); - // convert in to modular representation + /* convert in to modular representation */ v1 = mpnew(0); mpmod(in, rsa->p, v1); v2 = mpnew(0); mpmod(in, rsa->q, v2); - // exponentiate the modular rep + /* exponentiate the modular rep */ mpexp(v1, rsa->kp, rsa->p, v1); mpexp(v2, rsa->kq, rsa->q, v2); - // out = v1 + p*((v2-v1)*c2 mod q) + /* out = v1 + p*((v2-v1)*c2 mod q) */ mpsub(v2, v1, v2); mpmul(v2, rsa->c2, v2); mpmod(v2, rsa->q, v2); |