diff options
author | Ingela Anderton Andin <[email protected]> | 2010-06-09 09:37:04 +0000 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2010-06-09 09:37:04 +0000 |
commit | 5cec02b04436ac121d95cec59c98ced8deb477d8 (patch) | |
tree | bafdd82f1cb61c5b23ea7fa890f55ea50deffcc7 /lib/public_key/src/pubkey_crypto.erl | |
parent | 58076ca43949a935e36696608aefed373d6edbe9 (diff) | |
download | otp-5cec02b04436ac121d95cec59c98ced8deb477d8.tar.gz otp-5cec02b04436ac121d95cec59c98ced8deb477d8.tar.bz2 otp-5cec02b04436ac121d95cec59c98ced8deb477d8.zip |
Support new crypto function
Diffstat (limited to 'lib/public_key/src/pubkey_crypto.erl')
-rw-r--r-- | lib/public_key/src/pubkey_crypto.erl | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/public_key/src/pubkey_crypto.erl b/lib/public_key/src/pubkey_crypto.erl index 4ab655e977..7b7abb1c56 100644 --- a/lib/public_key/src/pubkey_crypto.erl +++ b/lib/public_key/src/pubkey_crypto.erl @@ -106,6 +106,11 @@ sign(DigestType, PlainText, #'RSAPrivateKey'{modulus = N, publicExponent = E, crypto:mpint(N), crypto:mpint(D)]); +sign(none, Hash, #'DSAPrivateKey'{p = P, q = Q, g = G, x = X}) -> + crypto:dss_sign(none, Hash, + [crypto:mpint(P), crypto:mpint(Q), + crypto:mpint(G), crypto:mpint(X)]); + sign(sha, PlainText, #'DSAPrivateKey'{p = P, q = Q, g = G, x = X}) -> crypto:dss_sign(sized_binary(PlainText), [crypto:mpint(P), crypto:mpint(Q), @@ -128,6 +133,12 @@ verify(DigestType, PlainText, Signature, sized_binary(Signature), [crypto:mpint(Exp), crypto:mpint(Mod)]); +verify(none, Hash, Signature, Key, #'Dss-Parms'{p = P, q = Q, g = G}) -> + crypto:dss_verify(none, Hash, + sized_binary(Signature), + [crypto:mpint(P), crypto:mpint(Q), + crypto:mpint(G), crypto:mpint(Key)]); + verify(sha, PlainText, Signature, Key, #'Dss-Parms'{p = P, q = Q, g = G}) -> crypto:dss_verify(sized_binary(PlainText), sized_binary(Signature), |