From 8e7719b8a5ae1d9e2e464d6d1a7abe502e0f9cd3 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 9 Jun 2010 12:01:01 +0000 Subject: OTP-8700 crypto:dss_sign and dss_verify with pre-hashed digest. New variants of crypto:dss_sign and crypto:dss_verify with an extra argument to control how the digest is calculated. --- lib/crypto/doc/src/crypto.xml | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'lib/crypto/doc') diff --git a/lib/crypto/doc/src/crypto.xml b/lib/crypto/doc/src/crypto.xml index 256eab3e3c..e1431cfd81 100644 --- a/lib/crypto/doc/src/crypto.xml +++ b/lib/crypto/doc/src/crypto.xml @@ -755,39 +755,44 @@ Mpint() = >]]> dss_sign(Data, Key) -> Signature + dss_sign(DigestType, Data, Key) -> Signature Sign the data using dsa with given private key. - Digest = Mpint + DigestType = sha | none (default is sha) + Data = Mpint | ShaDigest Key = [P, Q, G, X] P, Q, G, X = Mpint Where P, Q and G are the dss parameters and X is the private key. - Mpint = binary() + ShaDigest = binary() with length 20 bytes Signature = binary() -

Calculates the sha digest of the Data - and creates a DSS signature with the private key Key - of the digest.

+

Creates a DSS signature with the private key Key of a digest. + If DigestType is 'sha', the digest is calculated as SHA1 of Data. + If DigestType is 'none', Data is the precalculated SHA1 digest.

dss_verify(Data, Signature, Key) -> Verified + dss_verify(DigestType, Data, Signature, Key) -> Verified Verify the data and signature using dsa with given public key. Verified = boolean() - Digest, Signature = Mpint + DigestType = sha | none + Data = Mpint | ShaDigest + Signature = Mpint Key = [P, Q, G, Y] P, Q, G, Y = Mpint Where P, Q and G are the dss parameters and Y is the public key. - Mpint = binary() + ShaDigest = binary() with length 20 bytes -

Calculates the sha digest of the Data and verifies that the - digest matches the DSS signature using the public key Key. -

+

Verifies that a digest matches the DSS signature using the public key Key. + If DigestType is 'sha', the digest is calculated as SHA1 of Data. + If DigestType is 'none', Data is the precalculated SHA1 digest.

-- cgit v1.2.3