Skip to content

Commit

Permalink
Retire out-of-module KEM folder
Browse files Browse the repository at this point in the history
  • Loading branch information
torben-hansen committed Sep 6, 2024
1 parent 16ca6e7 commit 810df01
Show file tree
Hide file tree
Showing 11 changed files with 167 additions and 367 deletions.
2 changes: 0 additions & 2 deletions crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,6 @@ add_library(
ex_data.c
hpke/hpke.c
hrss/hrss.c
kem/kem.c
kem/kem_methods.c
kyber/kyber512r3_ref.c
kyber/kyber768r3_ref.c
kyber/kyber1024r3_ref.c
Expand Down
2 changes: 1 addition & 1 deletion crypto/evp_extra/evp_extra_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#include "../test/test_util.h"
#include "../internal.h"

#include "../kem/internal.h"
#include "../fipsmodule/evp/internal.h"
#include "../fipsmodule/kem/internal.h"


// kExampleRSAKeyDER is an RSA private key in ASN.1, DER format. Of course, you
Expand Down
File renamed without changes.
22 changes: 9 additions & 13 deletions crypto/fipsmodule/kem/kem.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <openssl/base.h>

#include "../../kem/internal.h"
#include "../../kyber/kem_kyber.h"
#include "../delocate.h"
#include "../ml_kem/ml_kem.h"
#include "internal.h"
Expand Down Expand Up @@ -169,27 +169,23 @@ DEFINE_LOCAL_DATA(KEM, KEM_ml_kem_1024) {
}

const KEM *KEM_find_kem_by_nid(int nid) {

switch (nid) {
case NID_MLKEM512:
return KEM_ml_kem_512();
case NID_MLKEM768:
return KEM_ml_kem_768();
case NID_MLKEM1024:
return KEM_ml_kem_1024();
// Try legacy KEMs.
case NID_KYBER512_R3:
return get_legacy_kem_kyber512_r3();
case NID_KYBER768_R3:
return get_legacy_kem_kyber768_r3();
case NID_KYBER1024_R3:
return get_legacy_kem_kyber1024_r3();
default:
break;
}

// We couldn't match a known KEM. Try legacy KEMs.
const KEM *legacy_kems = get_legacy_kems();
for (size_t i = 0; i < AWSLC_NUM_LEGACY_KEMS; i++) {
if (legacy_kems[i].nid == nid) {
return &legacy_kems[i];
}
return NULL;
}

return NULL;
}

KEM_KEY *KEM_KEY_new(void) {
Expand Down
27 changes: 0 additions & 27 deletions crypto/kem/internal.h

This file was deleted.

74 changes: 0 additions & 74 deletions crypto/kem/kem.c

This file was deleted.

125 changes: 0 additions & 125 deletions crypto/kem/kem_methods.c

This file was deleted.

Loading

0 comments on commit 810df01

Please sign in to comment.