summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ecdsa
diff options
context:
space:
mode:
authormiod <>2014-11-17 20:25:50 +0000
committermiod <>2014-11-17 20:25:50 +0000
commit1c596fb88a1bcb37040846b2e74feebb7d15fa27 (patch)
treeaab19a25918017d35545abd19424d33e05e96e6a /src/lib/libcrypto/ecdsa
parent1d73abd6ebdd0b8188330f94e644727d86b1d336 (diff)
downloadopenbsd-1c596fb88a1bcb37040846b2e74feebb7d15fa27.tar.gz
openbsd-1c596fb88a1bcb37040846b2e74feebb7d15fa27.tar.bz2
openbsd-1c596fb88a1bcb37040846b2e74feebb7d15fa27.zip
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!
Diffstat (limited to 'src/lib/libcrypto/ecdsa')
-rw-r--r--src/lib/libcrypto/ecdsa/ecdsa.h33
-rw-r--r--src/lib/libcrypto/ecdsa/ecs_locl.h27
2 files changed, 30 insertions, 30 deletions
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 @@
1/* $OpenBSD: ecdsa.h,v 1.2 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: ecdsa.h,v 1.3 2014/11/17 20:25:50 miod Exp $ */
2/** 2/**
3 * \file crypto/ecdsa/ecdsa.h Include file for the OpenSSL ECDSA functions 3 * \file crypto/ecdsa/ecdsa.h Include file for the OpenSSL ECDSA functions
4 * \author Written by Nils Larsch for the OpenSSL project 4 * \author Written by Nils Larsch for the OpenSSL project
@@ -75,11 +75,36 @@
75extern "C" { 75extern "C" {
76#endif 76#endif
77 77
78typedef struct ECDSA_SIG_st 78typedef struct ECDSA_SIG_st ECDSA_SIG;
79 { 79
80struct ecdsa_method {
81 const char *name;
82 ECDSA_SIG *(*ecdsa_do_sign)(const unsigned char *dgst, int dgst_len,
83 const BIGNUM *inv, const BIGNUM *rp, EC_KEY *eckey);
84 int (*ecdsa_sign_setup)(EC_KEY *eckey, BN_CTX *ctx, BIGNUM **kinv,
85 BIGNUM **r);
86 int (*ecdsa_do_verify)(const unsigned char *dgst, int dgst_len,
87 const ECDSA_SIG *sig, EC_KEY *eckey);
88#if 0
89 int (*init)(EC_KEY *eckey);
90 int (*finish)(EC_KEY *eckey);
91#endif
92 int flags;
93 char *app_data;
94};
95
96/* If this flag is set the ECDSA method is FIPS compliant and can be used
97 * in FIPS mode. This is set in the validated module method. If an
98 * application sets this flag in its own methods it is its responsibility
99 * to ensure the result is compliant.
100 */
101
102#define ECDSA_FLAG_FIPS_METHOD 0x1
103
104struct ECDSA_SIG_st {
80 BIGNUM *r; 105 BIGNUM *r;
81 BIGNUM *s; 106 BIGNUM *s;
82 } ECDSA_SIG; 107};
83 108
84/** Allocates and initialize a ECDSA_SIG structure 109/** Allocates and initialize a ECDSA_SIG structure
85 * \return pointer to a ECDSA_SIG structure or NULL if an error occurred 110 * \return pointer to a ECDSA_SIG structure or NULL if an error occurred
diff --git a/src/lib/libcrypto/ecdsa/ecs_locl.h b/src/lib/libcrypto/ecdsa/ecs_locl.h
index ceae6a2784..e47f6794ac 100644
--- a/src/lib/libcrypto/ecdsa/ecs_locl.h
+++ b/src/lib/libcrypto/ecdsa/ecs_locl.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ecs_locl.h,v 1.2 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: ecs_locl.h,v 1.3 2014/11/17 20:25:50 miod Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project 3 * Written by Nils Larsch for the OpenSSL project
4 */ 4 */
@@ -65,31 +65,6 @@
65extern "C" { 65extern "C" {
66#endif 66#endif
67 67
68struct ecdsa_method
69 {
70 const char *name;
71 ECDSA_SIG *(*ecdsa_do_sign)(const unsigned char *dgst, int dgst_len,
72 const BIGNUM *inv, const BIGNUM *rp, EC_KEY *eckey);
73 int (*ecdsa_sign_setup)(EC_KEY *eckey, BN_CTX *ctx, BIGNUM **kinv,
74 BIGNUM **r);
75 int (*ecdsa_do_verify)(const unsigned char *dgst, int dgst_len,
76 const ECDSA_SIG *sig, EC_KEY *eckey);
77#if 0
78 int (*init)(EC_KEY *eckey);
79 int (*finish)(EC_KEY *eckey);
80#endif
81 int flags;
82 char *app_data;
83 };
84
85/* If this flag is set the ECDSA method is FIPS compliant and can be used
86 * in FIPS mode. This is set in the validated module method. If an
87 * application sets this flag in its own methods it is its responsibility
88 * to ensure the result is compliant.
89 */
90
91#define ECDSA_FLAG_FIPS_METHOD 0x1
92
93typedef struct ecdsa_data_st { 68typedef struct ecdsa_data_st {
94 /* EC_KEY_METH_DATA part */ 69 /* EC_KEY_METH_DATA part */
95 int (*init)(EC_KEY *); 70 int (*init)(EC_KEY *);