Skip to content

Commit

Permalink
CR fixes, removed seed from KAT files, removed FIPS ind for derand me…
Browse files Browse the repository at this point in the history
…thods
  • Loading branch information
jakemas committed Jun 14, 2024
1 parent 7068cc6 commit 3578aee
Show file tree
Hide file tree
Showing 8 changed files with 453 additions and 864 deletions.
3 changes: 1 addition & 2 deletions crypto/evp_extra/evp_extra_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2651,11 +2651,10 @@ TEST_P(PerKEMTest, KAT) {

FileTestGTest(kat_filepath.c_str(), [&](FileTest *t) {
std::string count;
std::vector<uint8_t> seed, keypair_coins, encap_coins, pk_expected,
std::vector<uint8_t> keypair_coins, encap_coins, pk_expected,
sk_expected, ct_expected, ss_expected;

ASSERT_TRUE(t->GetAttribute(&count, "count"));
ASSERT_TRUE(t->GetBytes(&seed, "seed"));
ASSERT_TRUE(t->GetBytes(&keypair_coins, "keypair_coins"));
ASSERT_TRUE(t->GetBytes(&pk_expected, "pk"));
ASSERT_TRUE(t->GetBytes(&sk_expected, "sk"));
Expand Down
2 changes: 2 additions & 0 deletions crypto/evp_extra/p_kem.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ static int pkey_kem_encapsulate_deterministic(EVP_PKEY_CTX *ctx,
size_t *shared_secret_len,
const uint8_t *seed,
size_t *seed_len) {
GUARD_PTR(ctx);
KEM_PKEY_CTX *dctx = ctx->data;
GUARD_PTR(dctx);
const KEM *kem = dctx->kem;
if (kem == NULL) {
if (ctx->pkey == NULL) {
Expand Down
7 changes: 0 additions & 7 deletions crypto/fipsmodule/evp/evp_ctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,9 +443,6 @@ int EVP_PKEY_keygen_deterministic(EVP_PKEY_CTX *ctx,
EVP_PKEY **out_pkey,
const uint8_t *seed,
size_t *seed_len) {
// We have to avoid potential underlying services updating the indicator state,
// so we lock the state here.
FIPS_service_indicator_lock_state();
int ret = 0;
if (!ctx || !ctx->pmeth || !ctx->pmeth->keygen_deterministic) {
OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
Expand Down Expand Up @@ -476,10 +473,6 @@ int EVP_PKEY_keygen_deterministic(EVP_PKEY_CTX *ctx,

ret = 1;
end:
FIPS_service_indicator_unlock_state();
if(ret) {
EVP_PKEY_keygen_verify_service_indicator(*out_pkey);
}
return ret;
}

Expand Down
100 changes: 0 additions & 100 deletions crypto/kyber/kat/kyber1024r3.txt

Large diffs are not rendered by default.

100 changes: 0 additions & 100 deletions crypto/kyber/kat/kyber512r3.txt

Large diffs are not rendered by default.

100 changes: 0 additions & 100 deletions crypto/kyber/kat/kyber768r3.txt

Large diffs are not rendered by default.

100 changes: 0 additions & 100 deletions crypto/ml_kem/kat/mlkem512ipd.txt

Large diffs are not rendered by default.

905 changes: 450 additions & 455 deletions generated-src/crypto_test_data.cc

Large diffs are not rendered by default.

0 comments on commit 3578aee

Please sign in to comment.