summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ecdsa/ecs_sign.c
diff options
context:
space:
mode:
authortb <>2023-04-13 15:00:24 +0000
committertb <>2023-04-13 15:00:24 +0000
commit1f54371dd7e7019c23e6227ddb7b0eef5ff0468c (patch)
treec77c650b80a2a5715e9d9f734b2d0a9c4b3a9ff7 /src/lib/libcrypto/ecdsa/ecs_sign.c
parent15b6ca969589a3b9b2069bb0b796c42e2f146fc4 (diff)
downloadopenbsd-1f54371dd7e7019c23e6227ddb7b0eef5ff0468c.tar.gz
openbsd-1f54371dd7e7019c23e6227ddb7b0eef5ff0468c.tar.bz2
openbsd-1f54371dd7e7019c23e6227ddb7b0eef5ff0468c.zip
Fold ECDSA sign and verify mess into ecs_ossl.c
discussed with jsing
Diffstat (limited to 'src/lib/libcrypto/ecdsa/ecs_sign.c')
-rw-r--r--src/lib/libcrypto/ecdsa/ecs_sign.c43
1 files changed, 1 insertions, 42 deletions
diff --git a/src/lib/libcrypto/ecdsa/ecs_sign.c b/src/lib/libcrypto/ecdsa/ecs_sign.c
index 9aab20b0da..800529f7b2 100644
--- a/src/lib/libcrypto/ecdsa/ecs_sign.c
+++ b/src/lib/libcrypto/ecdsa/ecs_sign.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ecs_sign.c,v 1.10 2022/11/26 16:08:52 tb Exp $ */ 1/* $OpenBSD: ecs_sign.c,v 1.11 2023/04/13 15:00:24 tb Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -65,44 +65,3 @@
65#include "ecs_local.h" 65#include "ecs_local.h"
66#include "ec_local.h" 66#include "ec_local.h"
67 67
68ECDSA_SIG *
69ECDSA_do_sign(const unsigned char *dgst, int dlen, EC_KEY *eckey)
70{
71 return ECDSA_do_sign_ex(dgst, dlen, NULL, NULL, eckey);
72}
73
74ECDSA_SIG *
75ECDSA_do_sign_ex(const unsigned char *dgst, int dlen, const BIGNUM *kinv,
76 const BIGNUM *rp, EC_KEY *eckey)
77{
78 if (eckey->meth->sign_sig != NULL)
79 return eckey->meth->sign_sig(dgst, dlen, kinv, rp, eckey);
80 ECDSAerror(EVP_R_METHOD_NOT_SUPPORTED);
81 return 0;
82}
83
84int
85ECDSA_sign(int type, const unsigned char *dgst, int dlen, unsigned char *sig,
86 unsigned int *siglen, EC_KEY *eckey)
87{
88 return ECDSA_sign_ex(type, dgst, dlen, sig, siglen, NULL, NULL, eckey);
89}
90
91int
92ECDSA_sign_ex(int type, const unsigned char *dgst, int dlen, unsigned char *sig,
93 unsigned int *siglen, const BIGNUM *kinv, const BIGNUM *r, EC_KEY *eckey)
94{
95 if (eckey->meth->sign != NULL)
96 return eckey->meth->sign(type, dgst, dlen, sig, siglen, kinv, r, eckey);
97 ECDSAerror(EVP_R_METHOD_NOT_SUPPORTED);
98 return 0;
99}
100
101int
102ECDSA_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
103{
104 if (eckey->meth->sign_setup != NULL)
105 return eckey->meth->sign_setup(eckey, ctx_in, kinvp, rp);
106 ECDSAerror(EVP_R_METHOD_NOT_SUPPORTED);
107 return 0;
108}