extend EC_KEY_METHOD for signing support
authorDr. Stephen Henson <steve@openssl.org>
Tue, 27 Oct 2015 18:29:41 +0000 (18:29 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Wed, 9 Dec 2015 22:09:18 +0000 (22:09 +0000)
Reviewed-by: Richard Levitte <levitte@openssl.org>
crypto/ec/ec_lcl.h

index 38b8c80f6b5174a0b897a163fab8074dffe331bf..b18e8821dfee0eae4fd72aef0cf6ed413002c567 100644 (file)
@@ -571,6 +571,14 @@ struct ec_key_method_st {
                        EC_KEY *ecdh,
                        void *(*KDF) (const void *in, size_t inlen,
                                      void *out, size_t *outlen));
+
+    int (*sign_setup)(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp,
+                      BIGNUM **rp);
+    ECDSA_SIG *(*sign_sig)(const unsigned char *dgst, int dgst_len,
+                           const BIGNUM *in_kinv, const BIGNUM *in_r,
+                           EC_KEY *eckey);
+    int (*verify_sig)(const unsigned char *dgst, int dgst_len,
+                      const ECDSA_SIG *sig, EC_KEY *eckey);
 } /* EC_KEY_METHOD */ ;
 
 #define EC_KEY_METHOD_DYNAMIC   1
@@ -585,3 +593,11 @@ struct ECDSA_SIG_st {
     BIGNUM *r;
     BIGNUM *s;
 };
+
+int ossl_ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp,
+                          BIGNUM **rp);
+ECDSA_SIG *ossl_ecdsa_sign_sig(const unsigned char *dgst, int dgst_len,
+                               const BIGNUM *in_kinv, const BIGNUM *in_r,
+                               EC_KEY *eckey);
+int ossl_ecdsa_verify_sig(const unsigned char *dgst, int dgst_len,
+                          const ECDSA_SIG *sig, EC_KEY *eckey);