Skip to content

Commit

Permalink
Appease formatting linters
Browse files Browse the repository at this point in the history
  • Loading branch information
WillChilds-Klein committed Sep 29, 2023
1 parent 35eb9c9 commit cc80471
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion pq-crypto/s2n_kyber_evp.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ int s2n_kyber_evp_decapsulate(IN const struct s2n_kem *kem, OUT uint8_t *shared_
return S2N_SUCCESS;
}

#elif !defined(S2N_NO_PQ) // Use interned Kyber512 implementation, otherwise bail.
#elif !defined(S2N_NO_PQ) /* Use interned Kyber512 implementation, otherwise bail. */

int s2n_kyber_512_r3_crypto_kem_keypair(IN const struct s2n_kem *kem, OUT uint8_t *pk, OUT uint8_t *sk);
int s2n_kyber_evp_generate_keypair(IN const struct s2n_kem *kem, OUT uint8_t *public_key,
Expand Down
1 change: 0 additions & 1 deletion tests/unit/s2n_kem_preferences_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ int main(int argc, char **argv)
EXPECT_FALSE(s2n_kem_preferences_includes_tls13_kem_group(&test_prefs, TLS_PQ_KEM_GROUP_ID_SECP521R1_KYBER_1024_R3));
}


if (s2n_pq_is_enabled() && s2n_libcrypto_supports_kyber() && s2n_is_evp_apis_supported()) {
EXPECT_TRUE(s2n_kem_preferences_includes_tls13_kem_group(&test_prefs, TLS_PQ_KEM_GROUP_ID_X25519_KYBER_512_R3));
EXPECT_TRUE(s2n_kem_preferences_includes_tls13_kem_group(&test_prefs, TLS_PQ_KEM_GROUP_ID_X25519_KYBER_768_R3));
Expand Down
1 change: 0 additions & 1 deletion tests/unit/s2n_security_policies_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ int main(int argc, char **argv)
} else {
EXPECT_FALSE(kem_group_is_supported);
}

}
}

Expand Down
1 change: 0 additions & 1 deletion tests/unit/s2n_tls13_hybrid_shared_secret_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,6 @@ int main(int argc, char **argv)
EXPECT_NOT_NULL(client_conn = s2n_connection_new(S2N_CLIENT));
EXPECT_NOT_NULL(server_conn = s2n_connection_new(S2N_SERVER));


if (kem_group->available) {
EXPECT_SUCCESS(set_up_conns(client_conn, server_conn, test_vector->client_ecc_key,
test_vector->server_ecc_key, kem_group, test_vector->pq_secret));
Expand Down
13 changes: 6 additions & 7 deletions tls/s2n_kem.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@ typedef uint16_t kem_ciphertext_key_size;
#define IN /* Indicates a necessary function input */
#define OUT /* Indicates a function output */


#if defined(S2N_LIBCRYPTO_SUPPORTS_KYBER)
#define S2N_NID_KYBER512 NID_KYBER512_R3
#define S2N_NID_KYBER768 NID_KYBER768_R3
#define S2N_NID_KYBER1024 NID_KYBER1024_R3
#define S2N_NID_KYBER512 NID_KYBER512_R3
#define S2N_NID_KYBER768 NID_KYBER768_R3
#define S2N_NID_KYBER1024 NID_KYBER1024_R3
#else
#define S2N_NID_KYBER512 NID_undef
#define S2N_NID_KYBER768 NID_undef
#define S2N_NID_KYBER1024 NID_undef
#define S2N_NID_KYBER512 NID_undef
#define S2N_NID_KYBER768 NID_undef
#define S2N_NID_KYBER1024 NID_undef
#endif

struct s2n_kem {
Expand Down
5 changes: 2 additions & 3 deletions tls/s2n_kem_preferences.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ struct s2n_kem_group *pq_kem_groups_r3_2023_06[] = {
&s2n_x25519_kyber_512_r3,
};


const struct s2n_kem_preferences kem_preferences_pq_tls_1_0_2021_05 = {
.kem_count = s2n_array_len(pq_kems_r3_2021_05),
.kems = pq_kems_r3_2021_05,
Expand Down Expand Up @@ -101,8 +100,8 @@ bool s2n_tls13_client_must_use_hybrid_kem_length_prefix(const struct s2n_kem_pre
return kem_pref && (kem_pref->tls13_pq_hybrid_draft_revision == 0);
}


int s2n_kem_groups_available_count(const struct s2n_kem_preferences *kem_preferences) {
int s2n_kem_groups_available_count(const struct s2n_kem_preferences *kem_preferences)
{
if (kem_preferences == NULL) {
return 0;
}
Expand Down

0 comments on commit cc80471

Please sign in to comment.