Skip to content
Snippets Groups Projects
Commit 78a30313 authored by Martin Nilsson's avatar Martin Nilsson
Browse files

Fixed a resolver problem.

Rev: lib/modules/Crypto.pmod/RSA.pike:1.6
parent d499d525
Branches
Tags
No related merge requests found
/* $Id: RSA.pike,v 1.5 2004/02/08 03:21:02 nilsson Exp $ /* $Id: RSA.pike,v 1.6 2004/02/19 14:28:10 nilsson Exp $
* *
* Follow the PKCS#1 standard for padding and encryption. * Follow the PKCS#1 standard for padding and encryption.
*/ */
...@@ -233,7 +233,7 @@ int(0..1) verify(string msg, .Hash h, Gmp.mpz sign) ...@@ -233,7 +233,7 @@ int(0..1) verify(string msg, .Hash h, Gmp.mpz sign)
//! Document this function. //! Document this function.
string sha_sign(string message, mixed|void r) string sha_sign(string message, mixed|void r)
{ {
string s = Crypto.SHA1.hash(message); string s = Crypto.SHA1->hash(message);
s = sprintf("%c%s%c%s", 4, "sha1", sizeof(s), s); s = sprintf("%c%s%c%s", 4, "sha1", sizeof(s), s);
return cooked_sign(s); return cooked_sign(s);
} }
...@@ -242,7 +242,7 @@ string sha_sign(string message, mixed|void r) ...@@ -242,7 +242,7 @@ string sha_sign(string message, mixed|void r)
//! Document this function. //! Document this function.
int sha_verify(string message, string signature) int sha_verify(string message, string signature)
{ {
string s = Crypto.SHA1.hash(message); string s = Crypto.SHA1->hash(message);
s = sprintf("%c%s%c%s", 4, "sha1", sizeof(s), s); s = sprintf("%c%s%c%s", 4, "sha1", sizeof(s), s);
return raw_verify(s, Gmp.mpz(signature, 256)); return raw_verify(s, Gmp.mpz(signature, 256));
} }
...@@ -251,7 +251,7 @@ int sha_verify(string message, string signature) ...@@ -251,7 +251,7 @@ int sha_verify(string message, string signature)
//! Document this function. //! Document this function.
string md5_sign(string message, mixed|void r) string md5_sign(string message, mixed|void r)
{ {
string s = Crypto.MD5.hash(message); string s = Crypto.MD5->hash(message);
s = "0 0\14\6\10*\x86H\x86\xf7\15\2\5\5\0\4\20"+s; s = "0 0\14\6\10*\x86H\x86\xf7\15\2\5\5\0\4\20"+s;
return cooked_sign(s); return cooked_sign(s);
} }
...@@ -260,7 +260,7 @@ string md5_sign(string message, mixed|void r) ...@@ -260,7 +260,7 @@ string md5_sign(string message, mixed|void r)
//! Document this function. //! Document this function.
int md5_verify(string message, string signature) int md5_verify(string message, string signature)
{ {
string s = Crypto.MD5.hash(message); string s = Crypto.MD5->hash(message);
s = "0 0\14\6\10*\x86H\x86\xf7\15\2\5\5\0\4\20"+s; s = "0 0\14\6\10*\x86H\x86\xf7\15\2\5\5\0\4\20"+s;
return raw_verify(s, Gmp.mpz(signature, 256)); return raw_verify(s, Gmp.mpz(signature, 256));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment