| 1 |
// Copyright (c) 2021, Google Inc. |
| 2 |
// SPDX-License-Identifier: ISC |
| 3 |
|
| 4 |
#ifndef OPENSSL_HEADER_CRYPTO_FIPSMODULE_ECDSA_INTERNAL_H |
| 5 |
#define OPENSSL_HEADER_CRYPTO_FIPSMODULE_ECDSA_INTERNAL_H |
| 6 |
|
| 7 |
#include <openssl/base.h> |
| 8 |
|
| 9 |
#if defined(__cplusplus) |
| 10 |
extern "C" { |
| 11 |
#endif |
| 12 |
|
| 13 |
|
| 14 |
// ecdsa_sign_with_nonce_for_known_answer_test behaves like |ECDSA_do_sign| but |
| 15 |
// takes a fixed nonce. This function is used as part of known-answer tests in |
| 16 |
// the FIPS module. |
| 17 |
ECDSA_SIG *ecdsa_sign_with_nonce_for_known_answer_test(const uint8_t *digest, |
| 18 |
size_t digest_len, |
| 19 |
const EC_KEY *eckey, |
| 20 |
const uint8_t *nonce, |
| 21 |
size_t nonce_len); |
| 22 |
|
| 23 |
// ecdsa_do_verify_no_self_test does the same as |ECDSA_do_verify|, but doesn't |
| 24 |
// try to run the self-test first. This is for use in the self tests themselves, |
| 25 |
// to prevent an infinite loop. |
| 26 |
int ecdsa_do_verify_no_self_test(const uint8_t *digest, size_t digest_len, |
| 27 |
const ECDSA_SIG *sig, const EC_KEY *eckey); |
| 28 |
|
| 29 |
// ecdsa_digestsign_no_self_test calculates the digest and calls |
| 30 |
// |ecdsa_sign_with_nonce_for_known_answer_test|, which doesn't try to run the |
| 31 |
// self-test first. This is for use in the self tests themselves, to prevent |
| 32 |
// an infinite loop. |
| 33 |
ECDSA_SIG *ecdsa_digestsign_no_self_test(const EVP_MD *md, const uint8_t *input, |
| 34 |
size_t in_len, const EC_KEY *eckey, |
| 35 |
const uint8_t *nonce, |
| 36 |
size_t nonce_len); |
| 37 |
|
| 38 |
// ecdsa_digestverify_no_self_test calculates the digest and calls |
| 39 |
// |ecdsa_do_verify_no_self_test|, which doesn't try to run the self-test |
| 40 |
// first. This is for use in the self tests themselves, to prevent an infinite |
| 41 |
// loop. |
| 42 |
int ecdsa_digestverify_no_self_test(const EVP_MD *md, const uint8_t *input, |
| 43 |
size_t in_len, const ECDSA_SIG *sig, |
| 44 |
const EC_KEY *eckey); |
| 45 |
|
| 46 |
|
| 47 |
#if defined(__cplusplus) |
| 48 |
} |
| 49 |
#endif |
| 50 |
|
| 51 |
#endif // OPENSSL_HEADER_CRYPTO_FIPSMODULE_ECDSA_INTERNAL_H |