Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,19 @@ If an algorithm is provided by liboqs but is not listed below, it can still be u

#### Key Exchange

The following quantum-safe algorithms from liboqs are supported (assuming they have been enabled in liboqs):
The following quantum-safe algorithms from liboqs are supported (assuming they have been enabled in liboqs). In general, algorithms that are enabled by default are marked with an asterisk, and should you wish to enable additional variants, consult [the "Code Generation" section of the documentation in the wiki](https://github.com/open-quantum-safe/openssh/wiki/Using-liboqs-supported-algorithms-in-the-fork#code-generation).

<!--- OQS_TEMPLATE_FRAGMENT_LIST_ALL_KEXS_START -->
- **BIKE**: `bike-l1-sha512`, `bike-l3-sha512`, `bike-l5-sha512`
- **ClassicMcEliece**: `classic-mceliece-348864-sha256`, `classic-mceliece-348864f-sha256`, `classic-mceliece-460896-sha512`, `classic-mceliece-460896f-sha512`, `classic-mceliece-6688128-sha512`, `classic-mceliece-6688128f-sha512`, `classic-mceliece-6960119-sha512`, `classic-mceliece-6960119f-sha512`, `classic-mceliece-8192128-sha512`, `classic-mceliece-8192128f-sha512`
- **FrodoKEM**: `frodokem-640-aes-sha256`, `frodokem-976-aes-sha384`, `frodokem-1344-aes-sha512`, `frodokem-640-shake-sha256`, `frodokem-976-shake-sha384`, `frodokem-1344-shake-sha512`
- **BIKE**: `bike-l1-sha512`\*, `bike-l3-sha512`\*, `bike-l5-sha512`\*
- **ClassicMcEliece**: `classic-mceliece-348864-sha256`\*, `classic-mceliece-348864f-sha256`\*, `classic-mceliece-460896-sha512`\*, `classic-mceliece-460896f-sha512`\*, `classic-mceliece-6688128-sha512`\*, `classic-mceliece-6688128f-sha512`\*, `classic-mceliece-6960119-sha512`\*, `classic-mceliece-6960119f-sha512`\*, `classic-mceliece-8192128-sha512`\*, `classic-mceliece-8192128f-sha512`\*
- **FrodoKEM**: `frodokem-640-aes-sha256`\*, `frodokem-976-aes-sha384`\*, `frodokem-1344-aes-sha512`\*, `frodokem-640-shake-sha256`\*, `frodokem-976-shake-sha384`\*, `frodokem-1344-shake-sha512`\*
- **HQC**: `hqc-128-sha256`, `hqc-192-sha384`, `hqc-256-sha512`†
- **Kyber**: `kyber-512-sha256`, `kyber-768-sha384`, `kyber-1024-sha512`
- **ML-KEM**: `ml-kem-512-sha256`, `ml-kem-768-sha256`, `ml-kem-1024-sha384`
- **NTRU-Prime**: `ntruprime-sntrup761-sha512`
- **Kyber**: `kyber-512-sha256`\*, `kyber-768-sha384`\*, `kyber-1024-sha512`\*
- **ML-KEM**: `mlkem512-sha256`\*, `mlkem768-sha256`\*, `mlkem1024-sha384`\*
- **NTRU-Prime**: `ntruprime-sntrup761-sha512`\*
<!--- OQS_TEMPLATE_FRAGMENT_LIST_ALL_KEXS_END -->

The following hybrid algorithms are made available:
The following hybrid algorithms are made available (dependent on the associated quantum-safe algorithm being enabled):

<!--- OQS_TEMPLATE_FRAGMENT_LIST_ALL_HYBRID_KEXS_START -->
- **BIKE**: `ecdh-nistp256-bike-l1r4-sha512@openquantumsafe.org` `x25519-bike-l1r4-sha512@openquantumsafe.org` `ecdh-nistp384-bike-l3r4-sha512@openquantumsafe.org` `ecdh-nistp521-bike-l5r4-sha512@openquantumsafe.org`
Expand Down
7 changes: 0 additions & 7 deletions kex.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,6 @@ static const struct kexalg kexalgs[] = {
{ KEX_CLASSIC_MCELIECE_6960119F_SHA512, KEX_KEM_CLASSIC_MCELIECE_6960119F_SHA512, 0, SSH_DIGEST_SHA512 },
{ KEX_CLASSIC_MCELIECE_8192128_SHA512, KEX_KEM_CLASSIC_MCELIECE_8192128_SHA512, 0, SSH_DIGEST_SHA512 },
{ KEX_CLASSIC_MCELIECE_8192128F_SHA512, KEX_KEM_CLASSIC_MCELIECE_8192128F_SHA512, 0, SSH_DIGEST_SHA512 },
{ KEX_HQC_128_SHA256, KEX_KEM_HQC_128_SHA256, 0, SSH_DIGEST_SHA256 },
{ KEX_HQC_128_X25519_SHA256, KEX_KEM_HQC_128_X25519_SHA256, 0, SSH_DIGEST_SHA256 },
{ KEX_HQC_192_SHA384, KEX_KEM_HQC_192_SHA384, 0, SSH_DIGEST_SHA384 },
{ KEX_HQC_256_SHA512, KEX_KEM_HQC_256_SHA512, 0, SSH_DIGEST_SHA512 },
{ KEX_ML_KEM_512_SHA256, KEX_KEM_ML_KEM_512_SHA256, 0, SSH_DIGEST_SHA256 },
{ KEX_ML_KEM_512_X25519_SHA256, KEX_KEM_ML_KEM_512_X25519_SHA256, 0, SSH_DIGEST_SHA256 },
{ KEX_ML_KEM_768_SHA256, KEX_KEM_ML_KEM_768_SHA256, 0, SSH_DIGEST_SHA256 },
Expand Down Expand Up @@ -178,9 +174,6 @@ static const struct kexalg kexalgs[] = {
{ KEX_CLASSIC_MCELIECE_6960119F_ECDH_NISTP521_SHA512, KEX_KEM_CLASSIC_MCELIECE_6960119F_ECDH_NISTP521_SHA512, NID_secp521r1, SSH_DIGEST_SHA512 },
{ KEX_CLASSIC_MCELIECE_8192128_ECDH_NISTP521_SHA512, KEX_KEM_CLASSIC_MCELIECE_8192128_ECDH_NISTP521_SHA512, NID_secp521r1, SSH_DIGEST_SHA512 },
{ KEX_CLASSIC_MCELIECE_8192128F_ECDH_NISTP521_SHA512, KEX_KEM_CLASSIC_MCELIECE_8192128F_ECDH_NISTP521_SHA512, NID_secp521r1, SSH_DIGEST_SHA512 },
{ KEX_HQC_128_ECDH_NISTP256_SHA256, KEX_KEM_HQC_128_ECDH_NISTP256_SHA256, NID_X9_62_prime256v1, SSH_DIGEST_SHA256 },
{ KEX_HQC_192_ECDH_NISTP384_SHA384, KEX_KEM_HQC_192_ECDH_NISTP384_SHA384, NID_secp384r1, SSH_DIGEST_SHA384 },
{ KEX_HQC_256_ECDH_NISTP521_SHA512, KEX_KEM_HQC_256_ECDH_NISTP521_SHA512, NID_secp521r1, SSH_DIGEST_SHA512 },
{ KEX_ML_KEM_512_ECDH_NISTP256_SHA256, KEX_KEM_ML_KEM_512_ECDH_NISTP256_SHA256, NID_X9_62_prime256v1, SSH_DIGEST_SHA256 },
{ KEX_ML_KEM_768_ECDH_NISTP256_SHA256, KEX_KEM_ML_KEM_768_ECDH_NISTP256_SHA256, NID_X9_62_prime256v1, SSH_DIGEST_SHA256 },
{ KEX_ML_KEM_1024_ECDH_NISTP384_SHA384, KEX_KEM_ML_KEM_1024_ECDH_NISTP384_SHA384, NID_secp384r1, SSH_DIGEST_SHA384 },
Expand Down
44 changes: 3 additions & 41 deletions kex.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@
#define KEX_HQC_128_X25519_SHA256 "x25519-hqc-128r3-sha256@openquantumsafe.org"
#define KEX_HQC_192_SHA384 "hqc-192-sha384"
#define KEX_HQC_256_SHA512 "hqc-256-sha512"
#define KEX_ML_KEM_512_SHA256 "ml-kem-512-sha256"
#define KEX_ML_KEM_512_SHA256 "mlkem512-sha256"
#define KEX_ML_KEM_512_X25519_SHA256 "x25519-ml-kem-512-sha256@openquantumsafe.org"
#define KEX_ML_KEM_768_SHA256 "ml-kem-768-sha256"
#define KEX_ML_KEM_768_SHA256 "mlkem768-sha256"
#define KEX_ML_KEM_768_X25519_SHA256 "mlkem768x25519-sha256"
#define KEX_ML_KEM_1024_SHA384 "ml-kem-1024-sha384"
#define KEX_ML_KEM_1024_SHA384 "mlkem1024-sha384"
#define KEX_NTRUPRIME_SNTRUP761_SHA512 "sntrup761-sha512"
#define KEX_NTRUPRIME_SNTRUP761_X25519_SHA512 "sntrup761x25519-sha512@openssh.com"
#ifdef WITH_OPENSSL
Expand All @@ -127,9 +127,6 @@
#define KEX_CLASSIC_MCELIECE_6960119F_ECDH_NISTP521_SHA512 "ecdh-nistp521-classic-mceliece-6960119fr4-sha512@openquantumsafe.org"
#define KEX_CLASSIC_MCELIECE_8192128_ECDH_NISTP521_SHA512 "ecdh-nistp521-classic-mceliece-8192128r4-sha512@openquantumsafe.org"
#define KEX_CLASSIC_MCELIECE_8192128F_ECDH_NISTP521_SHA512 "ecdh-nistp521-classic-mceliece-8192128fr4-sha512@openquantumsafe.org"
#define KEX_HQC_128_ECDH_NISTP256_SHA256 "ecdh-nistp256-hqc-128r3-sha256@openquantumsafe.org"
#define KEX_HQC_192_ECDH_NISTP384_SHA384 "ecdh-nistp384-hqc-192r3-sha384@openquantumsafe.org"
#define KEX_HQC_256_ECDH_NISTP521_SHA512 "ecdh-nistp521-hqc-256r3-sha512@openquantumsafe.org"
#define KEX_ML_KEM_512_ECDH_NISTP256_SHA256 "ecdh-nistp256-ml-kem-512-sha256@openquantumsafe.org"
#define KEX_ML_KEM_768_ECDH_NISTP256_SHA256 "mlkem768nistp256-sha256"
#define KEX_ML_KEM_1024_ECDH_NISTP384_SHA384 "mlkem1024nistp384-sha384"
Expand Down Expand Up @@ -203,10 +200,6 @@ enum kex_exchange {
KEX_KEM_CLASSIC_MCELIECE_6960119F_SHA512,
KEX_KEM_CLASSIC_MCELIECE_8192128_SHA512,
KEX_KEM_CLASSIC_MCELIECE_8192128F_SHA512,
KEX_KEM_HQC_128_SHA256,
KEX_KEM_HQC_128_X25519_SHA256,
KEX_KEM_HQC_192_SHA384,
KEX_KEM_HQC_256_SHA512,
KEX_KEM_ML_KEM_512_SHA256,
KEX_KEM_ML_KEM_512_X25519_SHA256,
KEX_KEM_ML_KEM_768_SHA256,
Expand Down Expand Up @@ -238,9 +231,6 @@ enum kex_exchange {
KEX_KEM_CLASSIC_MCELIECE_6960119F_ECDH_NISTP521_SHA512,
KEX_KEM_CLASSIC_MCELIECE_8192128_ECDH_NISTP521_SHA512,
KEX_KEM_CLASSIC_MCELIECE_8192128F_ECDH_NISTP521_SHA512,
KEX_KEM_HQC_128_ECDH_NISTP256_SHA256,
KEX_KEM_HQC_192_ECDH_NISTP384_SHA384,
KEX_KEM_HQC_256_ECDH_NISTP521_SHA512,
KEX_KEM_ML_KEM_512_ECDH_NISTP256_SHA256,
KEX_KEM_ML_KEM_768_ECDH_NISTP256_SHA256,
KEX_KEM_ML_KEM_1024_ECDH_NISTP384_SHA384,
Expand Down Expand Up @@ -495,22 +485,6 @@ int kex_kem_classic_mceliece_8192128_dec(struct kex *, const struct sshbuf *, s
int kex_kem_classic_mceliece_8192128f_keypair(struct kex *);
int kex_kem_classic_mceliece_8192128f_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **);
int kex_kem_classic_mceliece_8192128f_dec(struct kex *, const struct sshbuf *, struct sshbuf **);
/* hqc_128 prototypes */
int kex_kem_hqc_128_keypair(struct kex *);
int kex_kem_hqc_128_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **);
int kex_kem_hqc_128_dec(struct kex *, const struct sshbuf *, struct sshbuf **);
/* hqc_128_x25519 prototypes */
int kex_kem_hqc_128_x25519_keypair(struct kex *);
int kex_kem_hqc_128_x25519_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **);
int kex_kem_hqc_128_x25519_dec(struct kex *, const struct sshbuf *, struct sshbuf **);
/* hqc_192 prototypes */
int kex_kem_hqc_192_keypair(struct kex *);
int kex_kem_hqc_192_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **);
int kex_kem_hqc_192_dec(struct kex *, const struct sshbuf *, struct sshbuf **);
/* hqc_256 prototypes */
int kex_kem_hqc_256_keypair(struct kex *);
int kex_kem_hqc_256_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **);
int kex_kem_hqc_256_dec(struct kex *, const struct sshbuf *, struct sshbuf **);
/* ml_kem_512 prototypes */
int kex_kem_ml_kem_512_keypair(struct kex *);
int kex_kem_ml_kem_512_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **);
Expand Down Expand Up @@ -629,18 +603,6 @@ int kex_kem_classic_mceliece_8192128_ecdh_nistp521_dec(struct kex *, const stru
int kex_kem_classic_mceliece_8192128f_ecdh_nistp521_keypair(struct kex *);
int kex_kem_classic_mceliece_8192128f_ecdh_nistp521_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **);
int kex_kem_classic_mceliece_8192128f_ecdh_nistp521_dec(struct kex *, const struct sshbuf *, struct sshbuf **);
/* hqc_128_nistp256 prototypes */
int kex_kem_hqc_128_ecdh_nistp256_keypair(struct kex *);
int kex_kem_hqc_128_ecdh_nistp256_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **);
int kex_kem_hqc_128_ecdh_nistp256_dec(struct kex *, const struct sshbuf *, struct sshbuf **);
/* hqc_192_nistp384 prototypes */
int kex_kem_hqc_192_ecdh_nistp384_keypair(struct kex *);
int kex_kem_hqc_192_ecdh_nistp384_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **);
int kex_kem_hqc_192_ecdh_nistp384_dec(struct kex *, const struct sshbuf *, struct sshbuf **);
/* hqc_256_nistp521 prototypes */
int kex_kem_hqc_256_ecdh_nistp521_keypair(struct kex *);
int kex_kem_hqc_256_ecdh_nistp521_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **);
int kex_kem_hqc_256_ecdh_nistp521_dec(struct kex *, const struct sshbuf *, struct sshbuf **);
/* ml_kem_512_nistp256 prototypes */
int kex_kem_ml_kem_512_ecdh_nistp256_keypair(struct kex *);
int kex_kem_ml_kem_512_ecdh_nistp256_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **);
Expand Down
70 changes: 0 additions & 70 deletions kexgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,18 +203,6 @@ kex_gen_client(struct ssh *ssh)
case KEX_KEM_CLASSIC_MCELIECE_8192128F_SHA512:
r = kex_kem_classic_mceliece_8192128f_keypair(kex);
break;
case KEX_KEM_HQC_128_SHA256:
r = kex_kem_hqc_128_keypair(kex);
break;
case KEX_KEM_HQC_128_X25519_SHA256:
r = kex_kem_hqc_128_x25519_keypair(kex);
break;
case KEX_KEM_HQC_192_SHA384:
r = kex_kem_hqc_192_keypair(kex);
break;
case KEX_KEM_HQC_256_SHA512:
r = kex_kem_hqc_256_keypair(kex);
break;
case KEX_KEM_ML_KEM_512_SHA256:
r = kex_kem_ml_kem_512_keypair(kex);
break;
Expand Down Expand Up @@ -304,15 +292,6 @@ kex_gen_client(struct ssh *ssh)
case KEX_KEM_CLASSIC_MCELIECE_8192128F_ECDH_NISTP521_SHA512:
r = kex_kem_classic_mceliece_8192128f_ecdh_nistp521_keypair(kex);
break;
case KEX_KEM_HQC_128_ECDH_NISTP256_SHA256:
r = kex_kem_hqc_128_ecdh_nistp256_keypair(kex);
break;
case KEX_KEM_HQC_192_ECDH_NISTP384_SHA384:
r = kex_kem_hqc_192_ecdh_nistp384_keypair(kex);
break;
case KEX_KEM_HQC_256_ECDH_NISTP521_SHA512:
r = kex_kem_hqc_256_ecdh_nistp521_keypair(kex);
break;
case KEX_KEM_ML_KEM_512_ECDH_NISTP256_SHA256:
r = kex_kem_ml_kem_512_ecdh_nistp256_keypair(kex);
break;
Expand Down Expand Up @@ -478,18 +457,6 @@ input_kex_gen_reply(int type, u_int32_t seq, struct ssh *ssh)
case KEX_KEM_CLASSIC_MCELIECE_8192128F_SHA512:
r = kex_kem_classic_mceliece_8192128f_dec(kex, server_blob, &shared_secret);
break;
case KEX_KEM_HQC_128_SHA256:
r = kex_kem_hqc_128_dec(kex, server_blob, &shared_secret);
break;
case KEX_KEM_HQC_128_X25519_SHA256:
r = kex_kem_hqc_128_x25519_dec(kex, server_blob, &shared_secret);
break;
case KEX_KEM_HQC_192_SHA384:
r = kex_kem_hqc_192_dec(kex, server_blob, &shared_secret);
break;
case KEX_KEM_HQC_256_SHA512:
r = kex_kem_hqc_256_dec(kex, server_blob, &shared_secret);
break;
case KEX_KEM_ML_KEM_512_SHA256:
r = kex_kem_ml_kem_512_dec(kex, server_blob, &shared_secret);
break;
Expand Down Expand Up @@ -579,15 +546,6 @@ input_kex_gen_reply(int type, u_int32_t seq, struct ssh *ssh)
case KEX_KEM_CLASSIC_MCELIECE_8192128F_ECDH_NISTP521_SHA512:
r = kex_kem_classic_mceliece_8192128f_ecdh_nistp521_dec(kex, server_blob, &shared_secret);
break;
case KEX_KEM_HQC_128_ECDH_NISTP256_SHA256:
r = kex_kem_hqc_128_ecdh_nistp256_dec(kex, server_blob, &shared_secret);
break;
case KEX_KEM_HQC_192_ECDH_NISTP384_SHA384:
r = kex_kem_hqc_192_ecdh_nistp384_dec(kex, server_blob, &shared_secret);
break;
case KEX_KEM_HQC_256_ECDH_NISTP521_SHA512:
r = kex_kem_hqc_256_ecdh_nistp521_dec(kex, server_blob, &shared_secret);
break;
case KEX_KEM_ML_KEM_512_ECDH_NISTP256_SHA256:
r = kex_kem_ml_kem_512_ecdh_nistp256_dec(kex, server_blob, &shared_secret);
break;
Expand Down Expand Up @@ -832,22 +790,6 @@ input_kex_gen_init(int type, u_int32_t seq, struct ssh *ssh)
r = kex_kem_classic_mceliece_8192128f_enc(kex, client_pubkey,
&server_pubkey, &shared_secret);
break;
case KEX_KEM_HQC_128_SHA256:
r = kex_kem_hqc_128_enc(kex, client_pubkey,
&server_pubkey, &shared_secret);
break;
case KEX_KEM_HQC_128_X25519_SHA256:
r = kex_kem_hqc_128_x25519_enc(kex, client_pubkey,
&server_pubkey, &shared_secret);
break;
case KEX_KEM_HQC_192_SHA384:
r = kex_kem_hqc_192_enc(kex, client_pubkey,
&server_pubkey, &shared_secret);
break;
case KEX_KEM_HQC_256_SHA512:
r = kex_kem_hqc_256_enc(kex, client_pubkey,
&server_pubkey, &shared_secret);
break;
case KEX_KEM_ML_KEM_512_SHA256:
r = kex_kem_ml_kem_512_enc(kex, client_pubkey,
&server_pubkey, &shared_secret);
Expand Down Expand Up @@ -966,18 +908,6 @@ input_kex_gen_init(int type, u_int32_t seq, struct ssh *ssh)
r = kex_kem_classic_mceliece_8192128f_ecdh_nistp521_enc(kex, client_pubkey,
&server_pubkey, &shared_secret);
break;
case KEX_KEM_HQC_128_ECDH_NISTP256_SHA256:
r = kex_kem_hqc_128_ecdh_nistp256_enc(kex, client_pubkey,
&server_pubkey, &shared_secret);
break;
case KEX_KEM_HQC_192_ECDH_NISTP384_SHA384:
r = kex_kem_hqc_192_ecdh_nistp384_enc(kex, client_pubkey,
&server_pubkey, &shared_secret);
break;
case KEX_KEM_HQC_256_ECDH_NISTP521_SHA512:
r = kex_kem_hqc_256_ecdh_nistp521_enc(kex, client_pubkey,
&server_pubkey, &shared_secret);
break;
case KEX_KEM_ML_KEM_512_ECDH_NISTP256_SHA256:
r = kex_kem_ml_kem_512_ecdh_nistp256_enc(kex, client_pubkey,
&server_pubkey, &shared_secret);
Expand Down
120 changes: 0 additions & 120 deletions kexoqs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1043,126 +1043,6 @@ int kex_kem_classic_mceliece_8192128f_dec(struct kex *kex,
OQS_KEM_free(kem);
return r;
}
/*---------------------------------------------------
* HQC_128 METHODS
*---------------------------------------------------
*/
int kex_kem_hqc_128_keypair(struct kex *kex)
{
OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_hqc_128);
if (kem == NULL) {
return SSH_ERR_ALLOC_FAIL;
}
int r = kex_kem_generic_keypair(kem, kex);
OQS_KEM_free(kem);
return r;
}
int kex_kem_hqc_128_enc(struct kex *kex,
const struct sshbuf *client_blob,
struct sshbuf **server_blobp,
struct sshbuf **shared_secretp)
{
OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_hqc_128);
if (kem == NULL) {
return SSH_ERR_ALLOC_FAIL;
}
int r = kex_kem_generic_enc(kem, kex, client_blob, server_blobp, shared_secretp);
OQS_KEM_free(kem);
return r;
}

int kex_kem_hqc_128_dec(struct kex *kex,
const struct sshbuf *server_blob,
struct sshbuf **shared_secretp)
{
OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_hqc_128);
if (kem == NULL) {
return SSH_ERR_ALLOC_FAIL;
}
int r = kex_kem_generic_dec(kem, kex, server_blob, shared_secretp);
OQS_KEM_free(kem);
return r;
}
/*---------------------------------------------------
* HQC_192 METHODS
*---------------------------------------------------
*/
int kex_kem_hqc_192_keypair(struct kex *kex)
{
OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_hqc_192);
if (kem == NULL) {
return SSH_ERR_ALLOC_FAIL;
}
int r = kex_kem_generic_keypair(kem, kex);
OQS_KEM_free(kem);
return r;
}
int kex_kem_hqc_192_enc(struct kex *kex,
const struct sshbuf *client_blob,
struct sshbuf **server_blobp,
struct sshbuf **shared_secretp)
{
OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_hqc_192);
if (kem == NULL) {
return SSH_ERR_ALLOC_FAIL;
}
int r = kex_kem_generic_enc(kem, kex, client_blob, server_blobp, shared_secretp);
OQS_KEM_free(kem);
return r;
}

int kex_kem_hqc_192_dec(struct kex *kex,
const struct sshbuf *server_blob,
struct sshbuf **shared_secretp)
{
OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_hqc_192);
if (kem == NULL) {
return SSH_ERR_ALLOC_FAIL;
}
int r = kex_kem_generic_dec(kem, kex, server_blob, shared_secretp);
OQS_KEM_free(kem);
return r;
}
/*---------------------------------------------------
* HQC_256 METHODS
*---------------------------------------------------
*/
int kex_kem_hqc_256_keypair(struct kex *kex)
{
OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_hqc_256);
if (kem == NULL) {
return SSH_ERR_ALLOC_FAIL;
}
int r = kex_kem_generic_keypair(kem, kex);
OQS_KEM_free(kem);
return r;
}
int kex_kem_hqc_256_enc(struct kex *kex,
const struct sshbuf *client_blob,
struct sshbuf **server_blobp,
struct sshbuf **shared_secretp)
{
OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_hqc_256);
if (kem == NULL) {
return SSH_ERR_ALLOC_FAIL;
}
int r = kex_kem_generic_enc(kem, kex, client_blob, server_blobp, shared_secretp);
OQS_KEM_free(kem);
return r;
}

int kex_kem_hqc_256_dec(struct kex *kex,
const struct sshbuf *server_blob,
struct sshbuf **shared_secretp)
{
OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_hqc_256);
if (kem == NULL) {
return SSH_ERR_ALLOC_FAIL;
}
int r = kex_kem_generic_dec(kem, kex, server_blob, shared_secretp);
OQS_KEM_free(kem);
return r;
}
/*---------------------------------------------------
* ML_KEM_512 METHODS
*---------------------------------------------------
Expand Down
Loading