123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260 |
- #ifndef HEADER_ECDSA_H
- #define HEADER_ECDSA_H
- #include "opensslconf.h"
- #ifdef OPENSSL_NO_ECDSA
- #error ECDSA is disabled.
- #endif
- #include "ec.h"
- #include "ossl_typ.h"
- #ifndef OPENSSL_NO_DEPRECATED
- #include "bn.h"
- #endif
- #ifdef __cplusplus
- extern "C" {
- #endif
- typedef struct ECDSA_SIG_st
- {
- BIGNUM *r;
- BIGNUM *s;
- } ECDSA_SIG;
- ECDSA_SIG *ECDSA_SIG_new(void);
- void ECDSA_SIG_free(ECDSA_SIG *sig);
- int i2d_ECDSA_SIG(const ECDSA_SIG *sig, unsigned char **pp);
- ECDSA_SIG *d2i_ECDSA_SIG(ECDSA_SIG **sig, const unsigned char **pp, long len);
- ECDSA_SIG *ECDSA_do_sign(const unsigned char *dgst,int dgst_len,EC_KEY *eckey);
- ECDSA_SIG *ECDSA_do_sign_ex(const unsigned char *dgst, int dgstlen,
- const BIGNUM *kinv, const BIGNUM *rp, EC_KEY *eckey);
- int ECDSA_do_verify(const unsigned char *dgst, int dgst_len,
- const ECDSA_SIG *sig, EC_KEY* eckey);
- const ECDSA_METHOD *ECDSA_OpenSSL(void);
- void ECDSA_set_default_method(const ECDSA_METHOD *meth);
- const ECDSA_METHOD *ECDSA_get_default_method(void);
- int ECDSA_set_method(EC_KEY *eckey, const ECDSA_METHOD *meth);
- int ECDSA_size(const EC_KEY *eckey);
- int ECDSA_sign_setup(EC_KEY *eckey, BN_CTX *ctx, BIGNUM **kinv,
- BIGNUM **rp);
- int ECDSA_sign(int type, const unsigned char *dgst, int dgstlen,
- unsigned char *sig, unsigned int *siglen, EC_KEY *eckey);
- int ECDSA_sign_ex(int type, const unsigned char *dgst, int dgstlen,
- unsigned char *sig, unsigned int *siglen, const BIGNUM *kinv,
- const BIGNUM *rp, EC_KEY *eckey);
- int ECDSA_verify(int type, const unsigned char *dgst, int dgstlen,
- const unsigned char *sig, int siglen, EC_KEY *eckey);
- int ECDSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new
- *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
- int ECDSA_set_ex_data(EC_KEY *d, int idx, void *arg);
- void *ECDSA_get_ex_data(EC_KEY *d, int idx);
- void ERR_load_ECDSA_strings(void);
- #define ECDSA_F_ECDSA_CHECK 104
- #define ECDSA_F_ECDSA_DATA_NEW_METHOD 100
- #define ECDSA_F_ECDSA_DO_SIGN 101
- #define ECDSA_F_ECDSA_DO_VERIFY 102
- #define ECDSA_F_ECDSA_SIGN_SETUP 103
- #define ECDSA_R_BAD_SIGNATURE 100
- #define ECDSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 101
- #define ECDSA_R_ERR_EC_LIB 102
- #define ECDSA_R_MISSING_PARAMETERS 103
- #define ECDSA_R_NEED_NEW_SETUP_VALUES 106
- #define ECDSA_R_NON_FIPS_METHOD 107
- #define ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED 104
- #define ECDSA_R_SIGNATURE_MALLOC_FAILED 105
- #ifdef __cplusplus
- }
- #endif
- #endif
|