summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ecdsa
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ecdsa')
-rw-r--r--src/lib/libcrypto/ecdsa/ecs_lib.c8
-rw-r--r--src/lib/libcrypto/ecdsa/ecs_local.h8
-rw-r--r--src/lib/libcrypto/ecdsa/ecs_ossl.c13
3 files changed, 14 insertions, 15 deletions
diff --git a/src/lib/libcrypto/ecdsa/ecs_lib.c b/src/lib/libcrypto/ecdsa/ecs_lib.c
index 743d517165..69aa1b732b 100644
--- a/src/lib/libcrypto/ecdsa/ecs_lib.c
+++ b/src/lib/libcrypto/ecdsa/ecs_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ecs_lib.c,v 1.22 2023/06/25 19:33:39 tb Exp $ */ 1/* $OpenBSD: ecs_lib.c,v 1.23 2023/07/05 08:39:40 tb Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -70,9 +70,9 @@ static const ECDSA_METHOD *default_ECDSA_method = NULL;
70 70
71static const ECDSA_METHOD openssl_ecdsa_meth = { 71static const ECDSA_METHOD openssl_ecdsa_meth = {
72 .name = "OpenSSL ECDSA method", 72 .name = "OpenSSL ECDSA method",
73 .ecdsa_do_sign = ossl_ecdsa_sign_sig, 73 .ecdsa_do_sign = ecdsa_sign_sig,
74 .ecdsa_sign_setup = ossl_ecdsa_sign_setup, 74 .ecdsa_sign_setup = ecdsa_sign_setup,
75 .ecdsa_do_verify = ossl_ecdsa_verify_sig, 75 .ecdsa_do_verify = ecdsa_verify_sig,
76}; 76};
77 77
78const ECDSA_METHOD * 78const ECDSA_METHOD *
diff --git a/src/lib/libcrypto/ecdsa/ecs_local.h b/src/lib/libcrypto/ecdsa/ecs_local.h
index 20ad0c246e..4f1140483f 100644
--- a/src/lib/libcrypto/ecdsa/ecs_local.h
+++ b/src/lib/libcrypto/ecdsa/ecs_local.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ecs_local.h,v 1.3 2023/06/25 18:45:56 tb Exp $ */ 1/* $OpenBSD: ecs_local.h,v 1.4 2023/07/05 08:39:40 tb Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project 3 * Written by Nils Larsch for the OpenSSL project
4 */ 4 */
@@ -68,12 +68,12 @@ struct ECDSA_SIG_st {
68 BIGNUM *s; 68 BIGNUM *s;
69}; 69};
70 70
71int ossl_ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp, 71int ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp,
72 BIGNUM **rp); 72 BIGNUM **rp);
73int ossl_ecdsa_sign(int type, const unsigned char *dgst, int dlen, 73int ecdsa_sign(int type, const unsigned char *dgst, int dlen,
74 unsigned char *sig, unsigned int *siglen, const BIGNUM *kinv, 74 unsigned char *sig, unsigned int *siglen, const BIGNUM *kinv,
75 const BIGNUM *r, EC_KEY *eckey); 75 const BIGNUM *r, EC_KEY *eckey);
76ECDSA_SIG *ossl_ecdsa_sign_sig(const unsigned char *dgst, int dgst_len, 76ECDSA_SIG *ecdsa_sign_sig(const unsigned char *dgst, int dgst_len,
77 const BIGNUM *in_kinv, const BIGNUM *in_r, EC_KEY *eckey); 77 const BIGNUM *in_kinv, const BIGNUM *in_r, EC_KEY *eckey);
78 78
79__END_HIDDEN_DECLS 79__END_HIDDEN_DECLS
diff --git a/src/lib/libcrypto/ecdsa/ecs_ossl.c b/src/lib/libcrypto/ecdsa/ecs_ossl.c
index 0ca2651f25..223cc655da 100644
--- a/src/lib/libcrypto/ecdsa/ecs_ossl.c
+++ b/src/lib/libcrypto/ecdsa/ecs_ossl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ecs_ossl.c,v 1.71 2023/07/04 15:09:31 tb Exp $ */ 1/* $OpenBSD: ecs_ossl.c,v 1.72 2023/07/05 08:39:40 tb Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project 3 * Written by Nils Larsch for the OpenSSL project
4 */ 4 */
@@ -97,7 +97,7 @@ ecdsa_prepare_digest(const unsigned char *digest, int digest_len,
97} 97}
98 98
99int 99int
100ossl_ecdsa_sign(int type, const unsigned char *digest, int digest_len, 100ecdsa_sign(int type, const unsigned char *digest, int digest_len,
101 unsigned char *signature, unsigned int *signature_len, const BIGNUM *kinv, 101 unsigned char *signature, unsigned int *signature_len, const BIGNUM *kinv,
102 const BIGNUM *r, EC_KEY *key) 102 const BIGNUM *r, EC_KEY *key)
103{ 103{
@@ -128,8 +128,7 @@ ossl_ecdsa_sign(int type, const unsigned char *digest, int digest_len,
128 */ 128 */
129 129
130int 130int
131ossl_ecdsa_sign_setup(EC_KEY *key, BN_CTX *in_ctx, BIGNUM **out_kinv, 131ecdsa_sign_setup(EC_KEY *key, BN_CTX *in_ctx, BIGNUM **out_kinv, BIGNUM **out_r)
132 BIGNUM **out_r)
133{ 132{
134 const EC_GROUP *group; 133 const EC_GROUP *group;
135 EC_POINT *point = NULL; 134 EC_POINT *point = NULL;
@@ -392,7 +391,7 @@ ecdsa_compute_s(BIGNUM **out_s, const BIGNUM *e, const BIGNUM *kinv,
392 */ 391 */
393 392
394ECDSA_SIG * 393ECDSA_SIG *
395ossl_ecdsa_sign_sig(const unsigned char *digest, int digest_len, 394ecdsa_sign_sig(const unsigned char *digest, int digest_len,
396 const BIGNUM *in_kinv, const BIGNUM *in_r, EC_KEY *key) 395 const BIGNUM *in_kinv, const BIGNUM *in_r, EC_KEY *key)
397{ 396{
398 BN_CTX *ctx = NULL; 397 BN_CTX *ctx = NULL;
@@ -485,7 +484,7 @@ ossl_ecdsa_sign_sig(const unsigned char *digest, int digest_len,
485} 484}
486 485
487int 486int
488ossl_ecdsa_verify(int type, const unsigned char *digest, int digest_len, 487ecdsa_verify(int type, const unsigned char *digest, int digest_len,
489 const unsigned char *sigbuf, int sig_len, EC_KEY *key) 488 const unsigned char *sigbuf, int sig_len, EC_KEY *key)
490{ 489{
491 ECDSA_SIG *s; 490 ECDSA_SIG *s;
@@ -522,7 +521,7 @@ ossl_ecdsa_verify(int type, const unsigned char *digest, int digest_len,
522 */ 521 */
523 522
524int 523int
525ossl_ecdsa_verify_sig(const unsigned char *digest, int digest_len, 524ecdsa_verify_sig(const unsigned char *digest, int digest_len,
526 const ECDSA_SIG *sig, EC_KEY *key) 525 const ECDSA_SIG *sig, EC_KEY *key)
527{ 526{
528 const EC_GROUP *group; 527 const EC_GROUP *group;