aboutsummaryrefslogtreecommitdiff
path: root/src/libsec/port/rsadecrypt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsec/port/rsadecrypt.c')
-rw-r--r--src/libsec/port/rsadecrypt.c12
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);