| 1 |
// Copyright (c) 2020, Google Inc. |
| 2 |
// SPDX-License-Identifier: ISC |
| 3 |
|
| 4 |
#ifndef OPENSSL_HEADER_DSA_INTERNAL_H |
| 5 |
#define OPENSSL_HEADER_DSA_INTERNAL_H |
| 6 |
|
| 7 |
#include <openssl/dsa.h> |
| 8 |
|
| 9 |
#include <openssl/thread.h> |
| 10 |
|
| 11 |
#if defined(__cplusplus) |
| 12 |
extern "C" { |
| 13 |
#endif |
| 14 |
|
| 15 |
|
| 16 |
struct dsa_st { |
| 17 |
BIGNUM *p; |
| 18 |
BIGNUM *q; |
| 19 |
BIGNUM *g; |
| 20 |
|
| 21 |
BIGNUM *pub_key; |
| 22 |
BIGNUM *priv_key; |
| 23 |
|
| 24 |
// Normally used to cache montgomery values |
| 25 |
CRYPTO_MUTEX method_mont_lock; |
| 26 |
BN_MONT_CTX *method_mont_p; |
| 27 |
BN_MONT_CTX *method_mont_q; |
| 28 |
CRYPTO_refcount_t references; |
| 29 |
CRYPTO_EX_DATA ex_data; |
| 30 |
}; |
| 31 |
|
| 32 |
// dsa_check_key performs cheap self-checks on |dsa|, and ensures it is within |
| 33 |
// DoS bounds. It returns one on success and zero on error. |
| 34 |
int dsa_check_key(const DSA *dsa); |
| 35 |
|
| 36 |
int dsa_internal_paramgen(DSA *dsa, size_t bits, const EVP_MD *evpmd, |
| 37 |
const unsigned char *seed_in, size_t seed_len, |
| 38 |
int *out_counter, unsigned long *out_h, BN_GENCB *cb); |
| 39 |
|
| 40 |
#if defined(__cplusplus) |
| 41 |
} // extern C |
| 42 |
#endif |
| 43 |
|
| 44 |
#endif // OPENSSL_HEADER_DSA_INTERNAL_H |