From 7b1e7706d8d69f09767e527116aa5ec0a8447a63 Mon Sep 17 00:00:00 2001 From: Nils Larsch Date: Thu, 19 May 2005 20:54:22 +0000 Subject: [PATCH] update ecdsa doc --- doc/crypto/ecdsa.pod | 66 +++++++++++++++----------------------------- 1 file changed, 22 insertions(+), 44 deletions(-) diff --git a/doc/crypto/ecdsa.pod b/doc/crypto/ecdsa.pod index ab3bef0712..49b10f2249 100644 --- a/doc/crypto/ecdsa.pod +++ b/doc/crypto/ecdsa.pod @@ -14,13 +14,11 @@ ecdsa - Elliptic Curve Digital Signature Algorithm ECDSA_SIG* d2i_ECDSA_SIG(ECDSA_SIG **sig, const unsigned char **pp, long len); - ECDSA_DATA* ECDSA_DATA_new(void); - ECDSA_DATA* ECDSA_DATA_new_method(ENGINE *eng); - void ECDSA_DATA_free(ECDSA_DATA *data); - ECDSA_DATA* ecdsa_check(EC_KEY *eckey); - ECDSA_SIG* ECDSA_do_sign(const unsigned char *dgst, int dgst_len, EC_KEY *eckey); + ECDSA_SIG* ECDSA_do_sign_ex(const unsigned char *dgst, int dgstlen, + const BIGNUM *kinv, const BIGNUM *rp, + EC_KEY *eckey); int ECDSA_do_verify(const unsigned char *dgst, int dgst_len, const ECDSA_SIG *sig, EC_KEY* eckey); int ECDSA_sign_setup(EC_KEY *eckey, BN_CTX *ctx, @@ -28,6 +26,10 @@ ecdsa - Elliptic Curve Digital Signature Algorithm int ECDSA_sign(int type, const unsigned char *dgst, int dgstlen, unsigned char *sig, unsigned int *siglen, EC_KEY *eckey); + int ECDSA_sign_ex(int type, const unsigned char *dgst, + int dgstlen, unsigned char *sig, + unsigned int *siglen, const BIGNUM *kinv, + const BIGNUM *rp, EC_KEY *eckey); int ECDSA_verify(int type, const unsigned char *dgst, int dgstlen, const unsigned char *sig, int siglen, EC_KEY *eckey); @@ -72,35 +74,6 @@ the decoded signature in a newly allocated B structure. B<*sig> points to the buffer containing the DER encoded signature of size B. -The B structure extends the B -structure with ECDSA specific data. - - struct - { - /* EC_KEY_METH_DATA part */ - int (*init)(EC_KEY *); - void (*finish)(EC_KEY *); - /* method (ECDSA) specific part */ - BIGNUM *kinv; /* signing pre-calc */ - BIGNUM *r; /* signing pre-calc */ - ... - } - ECDSA_DATA; - -B and B are used to store precomputed values (see -B). - -ECDSA_DATA_new() returns a newly allocated and initialized -B structure (or NULL on error). - -ECDSA_DATA_free() frees the B structure B. - -ecdsa_check() returns the pointer to the B -structure in Bmeth_data> (if Bmeth_data> -is not a pointer to a B structure then the old -data is freed and a new B structure is allocated -using B). - ECDSA_size() returns the maximum length of a DER encoded ECDSA signature created with the private EC key B. @@ -108,13 +81,15 @@ ECDSA_sign_setup() may be used to precompute parts of the signing operation. B is the private EC key and B is a pointer to B structure (or NULL). The precomputed values or returned in B and B and can be used in a -later call to B or B when placed in -Bkinv> and Br>. +later call to B or B. -ECDSA_sign() computes a digital signature of the B bytes -hash value B using the private EC key B and places -the DER encoding of the created signature in B. The length -of the created signature is returned in B. Note: B +ECDSA_sign() is wrapper function for ECDSA_sign_ex with B +and B set to NULL. + +ECDSA_sign_ex() computes a digital signature of the B bytes +hash value B using the private EC key B and the optional +pre-computed values B and B. The DER encoded signatures is +stored in B and it's length is returned in B. Note: B must point to B bytes of memory. The parameter B is ignored. @@ -123,10 +98,13 @@ B is a valid ECDSA signature of the hash value value B of size B using the public key B. The parameter B is ignored. -ECDSA_do_sign() computes a digital signature of the B -bytes hash value B using the private key B and -returns the signature in a newly allocated B structure -(or NULL on error). +ECDSA_do_sign() is wrapper function for ECDSA_do_sign_ex with B +and B set to NULL. + +ECDSA_do_sign_ex() computes a digital signature of the B +bytes hash value B using the private key B and the +optional pre-computed values B and B. The signature is +returned in a newly allocated B structure (or NULL on error). ECDSA_do_verify() verifies that the signature B is a valid ECDSA signature of the hash value B of size B -- 2.25.1