aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/restricted/aws/s2n/pq-crypto
diff options
context:
space:
mode:
authorrobot-contrib <robot-contrib@yandex-team.com>2023-03-28 10:12:33 +0300
committerrobot-contrib <robot-contrib@yandex-team.com>2023-03-28 10:12:33 +0300
commit7a815bed611966b3e27f438f43bc9dc7f69aef70 (patch)
tree0335bcf2d80c7d79a76496ffaa7bda87b6bbfdff /contrib/restricted/aws/s2n/pq-crypto
parent14a9357e8d2d937e22b789d5aea09219a3e92c31 (diff)
downloadydb-7a815bed611966b3e27f438f43bc9dc7f69aef70.tar.gz
Update contrib/restricted/aws/s2n to 1.3.39
Diffstat (limited to 'contrib/restricted/aws/s2n/pq-crypto')
-rw-r--r--contrib/restricted/aws/s2n/pq-crypto/s2n_kyber_512_evp.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/contrib/restricted/aws/s2n/pq-crypto/s2n_kyber_512_evp.c b/contrib/restricted/aws/s2n/pq-crypto/s2n_kyber_512_evp.c
index 36e6d3d85e..3d8411d6de 100644
--- a/contrib/restricted/aws/s2n/pq-crypto/s2n_kyber_512_evp.c
+++ b/contrib/restricted/aws/s2n/pq-crypto/s2n_kyber_512_evp.c
@@ -26,15 +26,15 @@
int s2n_kyber_512_evp_generate_keypair(uint8_t *public_key, uint8_t *private_key) {
EVP_PKEY_CTX *kyber_pkey_ctx = EVP_PKEY_CTX_new_id(EVP_PKEY_KYBER512, NULL);
POSIX_GUARD_PTR(kyber_pkey_ctx);
- POSIX_ENSURE(EVP_PKEY_keygen_init(kyber_pkey_ctx), S2N_FAILURE);
+ POSIX_GUARD_OSSL(EVP_PKEY_keygen_init(kyber_pkey_ctx), S2N_ERR_PQ_CRYPTO);
EVP_PKEY *kyber_pkey = NULL;
- POSIX_ENSURE(EVP_PKEY_keygen(kyber_pkey_ctx, &kyber_pkey), S2N_FAILURE);
+ POSIX_GUARD_OSSL(EVP_PKEY_keygen(kyber_pkey_ctx, &kyber_pkey), S2N_ERR_PQ_CRYPTO);
size_t public_key_size = S2N_KYBER_512_R3_PUBLIC_KEY_BYTES;
size_t private_key_size = S2N_KYBER_512_R3_SECRET_KEY_BYTES;
- POSIX_ENSURE(EVP_PKEY_get_raw_public_key(kyber_pkey, public_key, &public_key_size), S2N_FAILURE);
- POSIX_ENSURE(EVP_PKEY_get_raw_private_key(kyber_pkey, private_key, &private_key_size), S2N_FAILURE);
+ POSIX_GUARD_OSSL(EVP_PKEY_get_raw_public_key(kyber_pkey, public_key, &public_key_size), S2N_ERR_PQ_CRYPTO);
+ POSIX_GUARD_OSSL(EVP_PKEY_get_raw_private_key(kyber_pkey, private_key, &private_key_size), S2N_ERR_PQ_CRYPTO);
return S2N_SUCCESS;
}
@@ -50,8 +50,8 @@ int s2n_kyber_512_evp_encapsulate(uint8_t *ciphertext, uint8_t *shared_secret,
size_t cipher_text_size = S2N_KYBER_512_R3_CIPHERTEXT_BYTES;
size_t shared_secret_size = S2N_KYBER_512_R3_SHARED_SECRET_BYTES;
- POSIX_ENSURE(EVP_PKEY_encapsulate(kyber_pkey_ctx, ciphertext, &cipher_text_size, shared_secret,
- &shared_secret_size), S2N_FAILURE);
+ POSIX_GUARD_OSSL(EVP_PKEY_encapsulate(kyber_pkey_ctx, ciphertext, &cipher_text_size, shared_secret,
+ &shared_secret_size), S2N_ERR_PQ_CRYPTO);
return S2N_SUCCESS;
}
@@ -65,8 +65,8 @@ int s2n_kyber_512_evp_decapsulate(uint8_t *shared_secret, const uint8_t *ciphert
POSIX_GUARD_PTR(kyber_pkey_ctx);
size_t shared_secret_size = S2N_KYBER_512_R3_SHARED_SECRET_BYTES;
- POSIX_ENSURE(EVP_PKEY_decapsulate(kyber_pkey_ctx, shared_secret, &shared_secret_size, (uint8_t *) ciphertext,
- S2N_KYBER_512_R3_CIPHERTEXT_BYTES), S2N_FAILURE);
+ POSIX_GUARD_OSSL(EVP_PKEY_decapsulate(kyber_pkey_ctx, shared_secret, &shared_secret_size, (uint8_t *) ciphertext,
+ S2N_KYBER_512_R3_CIPHERTEXT_BYTES), S2N_ERR_PQ_CRYPTO);
return S2N_SUCCESS;
}
#else