summaryrefslogtreecommitdiff
path: root/lib/libcrypto/dsa/dsa_ossl.c
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2023-02-13 09:21:36 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2023-02-13 09:21:36 +0000
commit1d080ffeb35f55467b7a3e7efbfbd2253b996e4a (patch)
tree7dba5577f0aefbc356b9472cd9c1c60a663e1dc5 /lib/libcrypto/dsa/dsa_ossl.c
parent6b5c46132f97d896d0339f2c62b3274e6beeb8fd (diff)
Merge dsa_sign.c and dsa_vrf.c into dsa_ossl.c
discussed with jsing
Diffstat (limited to 'lib/libcrypto/dsa/dsa_ossl.c')
-rw-r--r--lib/libcrypto/dsa/dsa_ossl.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/lib/libcrypto/dsa/dsa_ossl.c b/lib/libcrypto/dsa/dsa_ossl.c
index a242291a62b..fd5fac64bb9 100644
--- a/lib/libcrypto/dsa/dsa_ossl.c
+++ b/lib/libcrypto/dsa/dsa_ossl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dsa_ossl.c,v 1.47 2023/01/11 04:39:42 jsing Exp $ */
+/* $OpenBSD: dsa_ossl.c,v 1.48 2023/02/13 09:21:35 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -433,3 +433,38 @@ dsa_finish(DSA *dsa)
BN_MONT_CTX_free(dsa->method_mont_p);
return 1;
}
+
+DSA_SIG *
+DSA_SIG_new(void)
+{
+ return calloc(1, sizeof(DSA_SIG));
+}
+
+void
+DSA_SIG_free(DSA_SIG *sig)
+{
+ if (sig == NULL)
+ return;
+
+ BN_free(sig->r);
+ BN_free(sig->s);
+ free(sig);
+}
+
+int
+DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
+{
+ return dsa->meth->dsa_sign_setup(dsa, ctx_in, kinvp, rp);
+}
+
+DSA_SIG *
+DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
+{
+ return dsa->meth->dsa_do_sign(dgst, dlen, dsa);
+}
+
+int
+DSA_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig, DSA *dsa)
+{
+ return dsa->meth->dsa_do_verify(dgst, dgst_len, sig, dsa);
+}