sync code with last fixes and improvements from OpenBSD
This commit is contained in:
parent
f960599e67
commit
691f97cc10
215 changed files with 1520 additions and 11518 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: ec.h,v 1.42 2023/07/05 17:10:10 tb Exp $ */
|
||||
/* $OpenBSD: ec.h,v 1.45 2023/07/28 09:28:37 tb Exp $ */
|
||||
/*
|
||||
* Originally written by Bodo Moeller for the OpenSSL project.
|
||||
*/
|
||||
|
@ -326,6 +326,36 @@ void EC_KEY_set_default_method(const EC_KEY_METHOD *meth);
|
|||
const EC_KEY_METHOD *EC_KEY_get_method(const EC_KEY *key);
|
||||
int EC_KEY_set_method(EC_KEY *key, const EC_KEY_METHOD *meth);
|
||||
EC_KEY *EC_KEY_new_method(ENGINE *engine);
|
||||
|
||||
int ECDH_size(const EC_KEY *ecdh);
|
||||
int ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key,
|
||||
EC_KEY *ecdh,
|
||||
void *(*KDF)(const void *in, size_t inlen, void *out, size_t *outlen));
|
||||
|
||||
typedef struct ECDSA_SIG_st 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);
|
||||
|
||||
const BIGNUM *ECDSA_SIG_get0_r(const ECDSA_SIG *sig);
|
||||
const BIGNUM *ECDSA_SIG_get0_s(const ECDSA_SIG *sig);
|
||||
void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps);
|
||||
int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s);
|
||||
|
||||
int ECDSA_size(const EC_KEY *eckey);
|
||||
|
||||
ECDSA_SIG *ECDSA_do_sign(const unsigned char *digest, int digest_len,
|
||||
EC_KEY *eckey);
|
||||
int ECDSA_do_verify(const unsigned char *digest, int digest_len,
|
||||
const ECDSA_SIG *sig, EC_KEY *eckey);
|
||||
|
||||
int ECDSA_sign(int type, const unsigned char *digest, int digest_len,
|
||||
unsigned char *signature, unsigned int *signature_len, EC_KEY *eckey);
|
||||
int ECDSA_verify(int type, const unsigned char *digest, int digest_len,
|
||||
const unsigned char *signature, int signature_len, EC_KEY *eckey);
|
||||
|
||||
EC_KEY_METHOD *EC_KEY_METHOD_new(const EC_KEY_METHOD *meth);
|
||||
void EC_KEY_METHOD_free(EC_KEY_METHOD *meth);
|
||||
void EC_KEY_METHOD_set_init(EC_KEY_METHOD *meth,
|
||||
|
@ -338,8 +368,20 @@ void EC_KEY_METHOD_set_init(EC_KEY_METHOD *meth,
|
|||
void EC_KEY_METHOD_set_keygen(EC_KEY_METHOD *meth,
|
||||
int (*keygen)(EC_KEY *key));
|
||||
void EC_KEY_METHOD_set_compute_key(EC_KEY_METHOD *meth,
|
||||
int (*ckey)(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *ecdh,
|
||||
void *(*KDF) (const void *in, size_t inlen, void *out, size_t *outlen)));
|
||||
int (*ckey)(unsigned char **out, size_t *out_len, const EC_POINT *pub_key,
|
||||
const EC_KEY *ecdh));
|
||||
void EC_KEY_METHOD_set_sign(EC_KEY_METHOD *meth,
|
||||
int (*sign)(int type, const unsigned char *digest, int digest_len,
|
||||
unsigned char *signature, unsigned int *signature_len,
|
||||
const BIGNUM *kinv, const BIGNUM *r, EC_KEY *eckey),
|
||||
int (*sign_setup)(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp),
|
||||
ECDSA_SIG *(*sign_sig)(const unsigned char *digest, int digest_len,
|
||||
const BIGNUM *in_kinv, const BIGNUM *in_r, EC_KEY *eckey));
|
||||
void EC_KEY_METHOD_set_verify(EC_KEY_METHOD *meth,
|
||||
int (*verify)(int type, const unsigned char *digest, int digest_len,
|
||||
const unsigned char *signature, int signature_len, EC_KEY *eckey),
|
||||
int (*verify_sig)(const unsigned char *digest, int digest_len,
|
||||
const ECDSA_SIG *sig, EC_KEY *eckey));
|
||||
void EC_KEY_METHOD_get_init(const EC_KEY_METHOD *meth,
|
||||
int (**pinit)(EC_KEY *key),
|
||||
void (**pfinish)(EC_KEY *key),
|
||||
|
@ -350,8 +392,20 @@ void EC_KEY_METHOD_get_init(const EC_KEY_METHOD *meth,
|
|||
void EC_KEY_METHOD_get_keygen(const EC_KEY_METHOD *meth,
|
||||
int (**pkeygen)(EC_KEY *key));
|
||||
void EC_KEY_METHOD_get_compute_key(const EC_KEY_METHOD *meth,
|
||||
int (**pck)(void *out, size_t outlen, const EC_POINT *pub_key, EC_KEY *ecdh,
|
||||
void *(*KDF) (const void *in, size_t inlen, void *out, size_t *outlen)));
|
||||
int (**pck)(unsigned char **out, size_t *out_len, const EC_POINT *pub_key,
|
||||
const EC_KEY *ecdh));
|
||||
void EC_KEY_METHOD_get_sign(const EC_KEY_METHOD *meth,
|
||||
int (**psign)(int type, const unsigned char *digest, int digest_len,
|
||||
unsigned char *signature, unsigned int *signature_len,
|
||||
const BIGNUM *kinv, const BIGNUM *r, EC_KEY *eckey),
|
||||
int (**psign_setup)(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp),
|
||||
ECDSA_SIG *(**psign_sig)(const unsigned char *digest, int digest_len,
|
||||
const BIGNUM *in_kinv, const BIGNUM *in_r, EC_KEY *eckey));
|
||||
void EC_KEY_METHOD_get_verify(const EC_KEY_METHOD *meth,
|
||||
int (**pverify)(int type, const unsigned char *digest, int digest_len,
|
||||
const unsigned char *signature, int signature_len, EC_KEY *eckey),
|
||||
int (**pverify_sig)(const unsigned char *digest, int digest_len,
|
||||
const ECDSA_SIG *sig, EC_KEY *eckey));
|
||||
|
||||
EC_KEY *ECParameters_dup(EC_KEY *key);
|
||||
|
||||
|
@ -630,6 +684,7 @@ void ERR_load_EC_strings(void);
|
|||
#define EC_R_INVALID_FORM 104
|
||||
#define EC_R_INVALID_GROUP_ORDER 122
|
||||
#define EC_R_INVALID_KEY 165
|
||||
#define EC_R_INVALID_OUTPUT_LENGTH 171
|
||||
#define EC_R_INVALID_PEER_KEY 152
|
||||
#define EC_R_INVALID_PENTANOMIAL_BASIS 132
|
||||
#define EC_R_INVALID_PRIVATE_KEY 123
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue