From ec5a7abcec7c1b9700073dfd54d84006e769961c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se> Date: Sun, 30 Nov 1997 12:58:43 +0100 Subject: [PATCH] Adapted to new pkcs module. Rev: lib/modules/Crypto/rsa.pike:1.13 --- lib/modules/Crypto/rsa.pike | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/modules/Crypto/rsa.pike b/lib/modules/Crypto/rsa.pike index a8bd7a5f7a..e3b649f597 100644 --- a/lib/modules/Crypto/rsa.pike +++ b/lib/modules/Crypto/rsa.pike @@ -1,4 +1,4 @@ -/* $Id: rsa.pike,v 1.12 1997/11/28 10:04:31 nisse Exp $ +/* $Id: rsa.pike,v 1.13 1997/11/30 11:58:43 nisse Exp $ * * Follow the PKCS#1 standard for padding and encryption. */ @@ -6,6 +6,8 @@ #define bignum object(Gmp.mpz) #define BIGNUM (Gmp.mpz) +import Standards.PKCS; + bignum n; /* modulo */ bignum e; /* public exponent */ bignum d; /* private exponent (if known) */ @@ -96,13 +98,13 @@ string rsa_unpad(bignum block, int type) object sign(string message, program h, mixed|void r) { - return rsa_pad(pkcs.build_digestinfo(message, h()), 1, r)->powm(d, n); + return rsa_pad(Signature.build_digestinfo(message, h()), 1, r)->powm(d, n); } int verify(string msg, program h, object sign) { // werror(sprintf("msg: '%s'\n", Crypto.string_to_hex(msg))); - string s = pkcs.build_digestinfo(msg, h()); + string s = Signature.build_digestinfo(msg, h()); // werror(sprintf("rsa: s = '%s'\n", s)); // werror(sprintf("decrypted: '%s'\n", sign->powm(e, n)->digits(256))); string s2 = rsa_unpad(sign->powm(e, n), 1); -- GitLab