}
int ED25519_sign(uint8_t *out_sig, const uint8_t *message, size_t message_len,
- const uint8_t public_key[32], const uint8_t private_key[32])
+ const uint8_t public_key[32], const uint8_t private_key[32],
+ OPENSSL_CTX *libctx, const char *propq)
{
uint8_t az[SHA512_DIGEST_LENGTH];
uint8_t nonce[SHA512_DIGEST_LENGTH];
ge_p3 R;
uint8_t hram[SHA512_DIGEST_LENGTH];
- EVP_MD *sha512 = EVP_MD_fetch(NULL, SN_sha512, NULL);
+ EVP_MD *sha512 = EVP_MD_fetch(libctx, SN_sha512, propq);
EVP_MD_CTX *hash_ctx = EVP_MD_CTX_new();
unsigned int sz;
int res = 0;
static const char allzeroes[15];
int ED25519_verify(const uint8_t *message, size_t message_len,
- const uint8_t signature[64], const uint8_t public_key[32])
+ const uint8_t signature[64], const uint8_t public_key[32],
+ OPENSSL_CTX *libctx, const char *propq)
{
int i;
ge_p3 A;
fe_neg(A.X, A.X);
fe_neg(A.T, A.T);
- sha512 = EVP_MD_fetch(NULL, SN_sha512, NULL);
+ sha512 = EVP_MD_fetch(libctx, SN_sha512, propq);
if (sha512 == NULL)
return 0;
hash_ctx = EVP_MD_CTX_new();
return 0;
}
- if (ED25519_sign(sig, tbs, tbslen, edkey->pubkey, edkey->privkey) == 0)
+ if (ED25519_sign(sig, tbs, tbslen, edkey->pubkey, edkey->privkey, NULL,
+ NULL) == 0)
return 0;
*siglen = ED25519_SIGSIZE;
return 1;
if (siglen != ED25519_SIGSIZE)
return 0;
- return ED25519_verify(tbs, tbslen, sig, edkey->pubkey);
+ return ED25519_verify(tbs, tbslen, sig, edkey->pubkey, NULL, NULL);
}
static int pkey_ecd_digestverify448(EVP_MD_CTX *ctx, const unsigned char *sig,
const uint8_t private_key[32]);
int ED25519_sign(uint8_t *out_sig, const uint8_t *message, size_t message_len,
- const uint8_t public_key[32], const uint8_t private_key[32]);
+ const uint8_t public_key[32], const uint8_t private_key[32],
+ OPENSSL_CTX *libctx, const char *propq);
int ED25519_verify(const uint8_t *message, size_t message_len,
- const uint8_t signature[64], const uint8_t public_key[32]);
+ const uint8_t signature[64], const uint8_t public_key[32],
+ OPENSSL_CTX *libctx, const char *propq);
int ED448_sign(OPENSSL_CTX *ctx, uint8_t *out_sig, const uint8_t *message,
size_t message_len, const uint8_t public_key[57],
return 0;
}
- if (ED25519_sign(sigret, tbs, tbslen, edkey->pubkey, edkey->privkey) == 0) {
+ if (ED25519_sign(sigret, tbs, tbslen, edkey->pubkey, edkey->privkey,
+ peddsactx->libctx, NULL) == 0) {
PROVerr(0, PROV_R_FAILED_TO_SIGN);
return 0;
}
if (siglen != ED25519_SIGSIZE)
return 0;
- return ED25519_verify(tbs, tbslen, sig, edkey->pubkey);
+ return ED25519_verify(tbs, tbslen, sig, edkey->pubkey, peddsactx->libctx,
+ NULL);
}
int ed448_digest_verify(void *vpeddsactx, const unsigned char *sig,