]> git.ipfire.org Git - thirdparty/openssl.git/blame - crypto/ec/ecdsa_vrf.c
Convert all {NAME}err() in crypto/ to their corresponding ERR_raise() call
[thirdparty/openssl.git] / crypto / ec / ecdsa_vrf.c
CommitLineData
a0bee97e 1/*
33388b44 2 * Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved.
4d94ae00 3 *
a7f182b7 4 * Licensed under the Apache License 2.0 (the "License"). You may not use
aa6bb135
RS
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
4d94ae00 8 */
0bee0e62 9
579422c8
P
10/*
11 * ECDSA low level APIs are deprecated for public use, but still ok for
12 * internal use.
13 */
14#include "internal/deprecated.h"
15
bd3602eb 16#include <openssl/ec.h>
706457b7 17#include "ec_local.h"
6e73d12e 18#include <openssl/err.h>
4d94ae00 19
1d97c843
TH
20/*-
21 * returns
4d94ae00
BM
22 * 1: correct signature
23 * 0: incorrect signature
24 * -1: error
25 */
0f113f3e
MC
26int ECDSA_do_verify(const unsigned char *dgst, int dgst_len,
27 const ECDSA_SIG *sig, EC_KEY *eckey)
28{
91e7bcc2 29 if (eckey->meth->verify_sig != NULL)
bd3602eb 30 return eckey->meth->verify_sig(dgst, dgst_len, sig, eckey);
9311d0c4 31 ERR_raise(ERR_LIB_EC, EC_R_OPERATION_NOT_SUPPORTED);
26583f6a 32 return -1;
0f113f3e 33}
4d94ae00 34
1d97c843
TH
35/*-
36 * returns
4d94ae00
BM
37 * 1: correct signature
38 * 0: incorrect signature
39 * -1: error
40 */
14a7cfb3 41int ECDSA_verify(int type, const unsigned char *dgst, int dgst_len,
0f113f3e
MC
42 const unsigned char *sigbuf, int sig_len, EC_KEY *eckey)
43{
91e7bcc2 44 if (eckey->meth->verify != NULL)
a200a817
DSH
45 return eckey->meth->verify(type, dgst, dgst_len, sigbuf, sig_len,
46 eckey);
9311d0c4 47 ERR_raise(ERR_LIB_EC, EC_R_OPERATION_NOT_SUPPORTED);
26583f6a 48 return -1;
0f113f3e 49}