Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
alexw91 committed Nov 20, 2023
1 parent 60e2922 commit 03e505b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion tests/fuzz/allowed_coverage_failures.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# since the fuzz test will immediately return an error that Kyber isn't supported. This isn't a fuzz test failure, so
# allow the Kyber fuzz tests to have zero branch coverage.
s2n_kyber_r3_recv_ciphertext_fuzz_test
s2n_kyber_r3_recv_public_key_fuzz_test
s2n_kyber_r3_recv_public_key_fuzz_test
15 changes: 5 additions & 10 deletions tests/unit/s2n_pq_kem_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,10 @@
#include "tls/s2n_kem.h"
#include "utils/s2n_safety.h"

struct s2n_kem_test_vector {
const struct s2n_kem *kem;
};

static const struct s2n_kem_test_vector test_vectors[] = {
{
.kem = &s2n_kyber_512_r3,
}
static const struct s2n_kem *test_vectors[] = {
&s2n_kyber_512_r3,
&s2n_kyber_768_r3,
&s2n_kyber_1024_r3,
};

/* EXPECT_SUCCESS checks explicitly function_call != -1; the PQ KEM functions may return
Expand All @@ -50,8 +46,7 @@ int main()
#endif

for (size_t i = 0; i < s2n_array_len(test_vectors); i++) {
const struct s2n_kem_test_vector vector = test_vectors[i];
const struct s2n_kem *kem = vector.kem;
const struct s2n_kem *kem = test_vectors[i];

DEFER_CLEANUP(struct s2n_blob public_key = { 0 }, s2n_free);
EXPECT_SUCCESS(s2n_alloc(&public_key, kem->public_key_length));
Expand Down

0 comments on commit 03e505b

Please sign in to comment.