From 1c596fb88a1bcb37040846b2e74feebb7d15fa27 Mon Sep 17 00:00:00 2001 From: miod <> Date: Mon, 17 Nov 2014 20:25:50 +0000 Subject: Make the ECDSA_SIG bowels public. This matches RSA_SIG and DSA_SIG, and we expect a good use for this knowledge in the tree in the near future. Contributed by Vincent Gross, thanks! --- src/lib/libcrypto/ecdsa/ecdsa.h | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) (limited to 'src/lib/libcrypto/ecdsa/ecdsa.h') diff --git a/src/lib/libcrypto/ecdsa/ecdsa.h b/src/lib/libcrypto/ecdsa/ecdsa.h index a29e5f6f6b..ad716c24a5 100644 --- a/src/lib/libcrypto/ecdsa/ecdsa.h +++ b/src/lib/libcrypto/ecdsa/ecdsa.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ecdsa.h,v 1.2 2014/06/12 15:49:29 deraadt Exp $ */ +/* $OpenBSD: ecdsa.h,v 1.3 2014/11/17 20:25:50 miod Exp $ */ /** * \file crypto/ecdsa/ecdsa.h Include file for the OpenSSL ECDSA functions * \author Written by Nils Larsch for the OpenSSL project @@ -75,11 +75,36 @@ extern "C" { #endif -typedef struct ECDSA_SIG_st - { +typedef struct ECDSA_SIG_st ECDSA_SIG; + +struct ecdsa_method { + const char *name; + ECDSA_SIG *(*ecdsa_do_sign)(const unsigned char *dgst, int dgst_len, + const BIGNUM *inv, const BIGNUM *rp, EC_KEY *eckey); + int (*ecdsa_sign_setup)(EC_KEY *eckey, BN_CTX *ctx, BIGNUM **kinv, + BIGNUM **r); + int (*ecdsa_do_verify)(const unsigned char *dgst, int dgst_len, + const ECDSA_SIG *sig, EC_KEY *eckey); +#if 0 + int (*init)(EC_KEY *eckey); + int (*finish)(EC_KEY *eckey); +#endif + int flags; + char *app_data; +}; + +/* If this flag is set the ECDSA method is FIPS compliant and can be used + * in FIPS mode. This is set in the validated module method. If an + * application sets this flag in its own methods it is its responsibility + * to ensure the result is compliant. + */ + +#define ECDSA_FLAG_FIPS_METHOD 0x1 + +struct ECDSA_SIG_st { BIGNUM *r; BIGNUM *s; - } ECDSA_SIG; +}; /** Allocates and initialize a ECDSA_SIG structure * \return pointer to a ECDSA_SIG structure or NULL if an error occurred -- cgit v1.2.3-55-g6feb