Skip to content

Commit 65b74b7

Browse files
committed
Run code generation script
Signed-off-by: Spencer Wilson <spencer.wilson@uwaterloo.ca>
1 parent 77cb997 commit 65b74b7

File tree

14 files changed

+6
-465
lines changed

14 files changed

+6
-465
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ If an algorithm is provided by liboqs but is not listed below, it can still be u
6161
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).
6262

6363
<!--- OQS_TEMPLATE_FRAGMENT_LIST_ALL_KEXS_START -->
64-
- **BIKE**: `bike-l1-sha512`, `bike-l3-sha512`, `bike-l5-sha512`
65-
- **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`
66-
- **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`
64+
- **BIKE**: `bike-l1-sha512`\*, `bike-l3-sha512`\*, `bike-l5-sha512`\*
65+
- **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`\*
66+
- **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`\*
6767
- **HQC**: `hqc-128-sha256`, `hqc-192-sha384`, `hqc-256-sha512`
68-
- **Kyber**: `kyber-512-sha256`, `kyber-768-sha384`, `kyber-1024-sha512`
69-
- **ML-KEM**: `ml-kem-512-sha256`, `ml-kem-768-sha256`, `ml-kem-1024-sha384`
70-
- **NTRU-Prime**: `ntruprime-sntrup761-sha512`
68+
- **Kyber**: `kyber-512-sha256`\*, `kyber-768-sha384`\*, `kyber-1024-sha512`\*
69+
- **ML-KEM**: `ml-kem-512-sha256`\*, `ml-kem-768-sha256`\*, `ml-kem-1024-sha384`\*
70+
- **NTRU-Prime**: `ntruprime-sntrup761-sha512`\*
7171
<!--- OQS_TEMPLATE_FRAGMENT_LIST_ALL_KEXS_END -->
7272

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

kex.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,6 @@ static const struct kexalg kexalgs[] = {
144144
{ KEX_CLASSIC_MCELIECE_6960119F_SHA512, KEX_KEM_CLASSIC_MCELIECE_6960119F_SHA512, 0, SSH_DIGEST_SHA512 },
145145
{ KEX_CLASSIC_MCELIECE_8192128_SHA512, KEX_KEM_CLASSIC_MCELIECE_8192128_SHA512, 0, SSH_DIGEST_SHA512 },
146146
{ KEX_CLASSIC_MCELIECE_8192128F_SHA512, KEX_KEM_CLASSIC_MCELIECE_8192128F_SHA512, 0, SSH_DIGEST_SHA512 },
147-
{ KEX_HQC_128_SHA256, KEX_KEM_HQC_128_SHA256, 0, SSH_DIGEST_SHA256 },
148-
{ KEX_HQC_128_X25519_SHA256, KEX_KEM_HQC_128_X25519_SHA256, 0, SSH_DIGEST_SHA256 },
149-
{ KEX_HQC_192_SHA384, KEX_KEM_HQC_192_SHA384, 0, SSH_DIGEST_SHA384 },
150-
{ KEX_HQC_256_SHA512, KEX_KEM_HQC_256_SHA512, 0, SSH_DIGEST_SHA512 },
151147
{ KEX_ML_KEM_512_SHA256, KEX_KEM_ML_KEM_512_SHA256, 0, SSH_DIGEST_SHA256 },
152148
{ KEX_ML_KEM_512_X25519_SHA256, KEX_KEM_ML_KEM_512_X25519_SHA256, 0, SSH_DIGEST_SHA256 },
153149
{ KEX_ML_KEM_768_SHA256, KEX_KEM_ML_KEM_768_SHA256, 0, SSH_DIGEST_SHA256 },
@@ -178,9 +174,6 @@ static const struct kexalg kexalgs[] = {
178174
{ KEX_CLASSIC_MCELIECE_6960119F_ECDH_NISTP521_SHA512, KEX_KEM_CLASSIC_MCELIECE_6960119F_ECDH_NISTP521_SHA512, NID_secp521r1, SSH_DIGEST_SHA512 },
179175
{ KEX_CLASSIC_MCELIECE_8192128_ECDH_NISTP521_SHA512, KEX_KEM_CLASSIC_MCELIECE_8192128_ECDH_NISTP521_SHA512, NID_secp521r1, SSH_DIGEST_SHA512 },
180176
{ KEX_CLASSIC_MCELIECE_8192128F_ECDH_NISTP521_SHA512, KEX_KEM_CLASSIC_MCELIECE_8192128F_ECDH_NISTP521_SHA512, NID_secp521r1, SSH_DIGEST_SHA512 },
181-
{ KEX_HQC_128_ECDH_NISTP256_SHA256, KEX_KEM_HQC_128_ECDH_NISTP256_SHA256, NID_X9_62_prime256v1, SSH_DIGEST_SHA256 },
182-
{ KEX_HQC_192_ECDH_NISTP384_SHA384, KEX_KEM_HQC_192_ECDH_NISTP384_SHA384, NID_secp384r1, SSH_DIGEST_SHA384 },
183-
{ KEX_HQC_256_ECDH_NISTP521_SHA512, KEX_KEM_HQC_256_ECDH_NISTP521_SHA512, NID_secp521r1, SSH_DIGEST_SHA512 },
184177
{ KEX_ML_KEM_512_ECDH_NISTP256_SHA256, KEX_KEM_ML_KEM_512_ECDH_NISTP256_SHA256, NID_X9_62_prime256v1, SSH_DIGEST_SHA256 },
185178
{ KEX_ML_KEM_768_ECDH_NISTP256_SHA256, KEX_KEM_ML_KEM_768_ECDH_NISTP256_SHA256, NID_X9_62_prime256v1, SSH_DIGEST_SHA256 },
186179
{ KEX_ML_KEM_1024_ECDH_NISTP384_SHA384, KEX_KEM_ML_KEM_1024_ECDH_NISTP384_SHA384, NID_secp384r1, SSH_DIGEST_SHA384 },

kex.h

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,6 @@
9292
#define KEX_CLASSIC_MCELIECE_6960119F_SHA512 "classic-mceliece-6960119f-sha512"
9393
#define KEX_CLASSIC_MCELIECE_8192128_SHA512 "classic-mceliece-8192128-sha512"
9494
#define KEX_CLASSIC_MCELIECE_8192128F_SHA512 "classic-mceliece-8192128f-sha512"
95-
#define KEX_HQC_128_SHA256 "hqc-128-sha256"
96-
#define KEX_HQC_128_X25519_SHA256 "x25519-hqc-128r3-sha256@openquantumsafe.org"
97-
#define KEX_HQC_192_SHA384 "hqc-192-sha384"
98-
#define KEX_HQC_256_SHA512 "hqc-256-sha512"
9995
#define KEX_ML_KEM_512_SHA256 "ml-kem-512-sha256"
10096
#define KEX_ML_KEM_512_X25519_SHA256 "x25519-ml-kem-512-sha256@openquantumsafe.org"
10197
#define KEX_ML_KEM_768_SHA256 "ml-kem-768-sha256"
@@ -127,9 +123,6 @@
127123
#define KEX_CLASSIC_MCELIECE_6960119F_ECDH_NISTP521_SHA512 "ecdh-nistp521-classic-mceliece-6960119fr4-sha512@openquantumsafe.org"
128124
#define KEX_CLASSIC_MCELIECE_8192128_ECDH_NISTP521_SHA512 "ecdh-nistp521-classic-mceliece-8192128r4-sha512@openquantumsafe.org"
129125
#define KEX_CLASSIC_MCELIECE_8192128F_ECDH_NISTP521_SHA512 "ecdh-nistp521-classic-mceliece-8192128fr4-sha512@openquantumsafe.org"
130-
#define KEX_HQC_128_ECDH_NISTP256_SHA256 "ecdh-nistp256-hqc-128r3-sha256@openquantumsafe.org"
131-
#define KEX_HQC_192_ECDH_NISTP384_SHA384 "ecdh-nistp384-hqc-192r3-sha384@openquantumsafe.org"
132-
#define KEX_HQC_256_ECDH_NISTP521_SHA512 "ecdh-nistp521-hqc-256r3-sha512@openquantumsafe.org"
133126
#define KEX_ML_KEM_512_ECDH_NISTP256_SHA256 "ecdh-nistp256-ml-kem-512-sha256@openquantumsafe.org"
134127
#define KEX_ML_KEM_768_ECDH_NISTP256_SHA256 "mlkem768nistp256-sha256"
135128
#define KEX_ML_KEM_1024_ECDH_NISTP384_SHA384 "mlkem1024nistp384-sha384"
@@ -203,10 +196,6 @@ enum kex_exchange {
203196
KEX_KEM_CLASSIC_MCELIECE_6960119F_SHA512,
204197
KEX_KEM_CLASSIC_MCELIECE_8192128_SHA512,
205198
KEX_KEM_CLASSIC_MCELIECE_8192128F_SHA512,
206-
KEX_KEM_HQC_128_SHA256,
207-
KEX_KEM_HQC_128_X25519_SHA256,
208-
KEX_KEM_HQC_192_SHA384,
209-
KEX_KEM_HQC_256_SHA512,
210199
KEX_KEM_ML_KEM_512_SHA256,
211200
KEX_KEM_ML_KEM_512_X25519_SHA256,
212201
KEX_KEM_ML_KEM_768_SHA256,
@@ -238,9 +227,6 @@ enum kex_exchange {
238227
KEX_KEM_CLASSIC_MCELIECE_6960119F_ECDH_NISTP521_SHA512,
239228
KEX_KEM_CLASSIC_MCELIECE_8192128_ECDH_NISTP521_SHA512,
240229
KEX_KEM_CLASSIC_MCELIECE_8192128F_ECDH_NISTP521_SHA512,
241-
KEX_KEM_HQC_128_ECDH_NISTP256_SHA256,
242-
KEX_KEM_HQC_192_ECDH_NISTP384_SHA384,
243-
KEX_KEM_HQC_256_ECDH_NISTP521_SHA512,
244230
KEX_KEM_ML_KEM_512_ECDH_NISTP256_SHA256,
245231
KEX_KEM_ML_KEM_768_ECDH_NISTP256_SHA256,
246232
KEX_KEM_ML_KEM_1024_ECDH_NISTP384_SHA384,
@@ -495,22 +481,6 @@ int kex_kem_classic_mceliece_8192128_dec(struct kex *, const struct sshbuf *, s
495481
int kex_kem_classic_mceliece_8192128f_keypair(struct kex *);
496482
int kex_kem_classic_mceliece_8192128f_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **);
497483
int kex_kem_classic_mceliece_8192128f_dec(struct kex *, const struct sshbuf *, struct sshbuf **);
498-
/* hqc_128 prototypes */
499-
int kex_kem_hqc_128_keypair(struct kex *);
500-
int kex_kem_hqc_128_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **);
501-
int kex_kem_hqc_128_dec(struct kex *, const struct sshbuf *, struct sshbuf **);
502-
/* hqc_128_x25519 prototypes */
503-
int kex_kem_hqc_128_x25519_keypair(struct kex *);
504-
int kex_kem_hqc_128_x25519_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **);
505-
int kex_kem_hqc_128_x25519_dec(struct kex *, const struct sshbuf *, struct sshbuf **);
506-
/* hqc_192 prototypes */
507-
int kex_kem_hqc_192_keypair(struct kex *);
508-
int kex_kem_hqc_192_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **);
509-
int kex_kem_hqc_192_dec(struct kex *, const struct sshbuf *, struct sshbuf **);
510-
/* hqc_256 prototypes */
511-
int kex_kem_hqc_256_keypair(struct kex *);
512-
int kex_kem_hqc_256_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **);
513-
int kex_kem_hqc_256_dec(struct kex *, const struct sshbuf *, struct sshbuf **);
514484
/* ml_kem_512 prototypes */
515485
int kex_kem_ml_kem_512_keypair(struct kex *);
516486
int kex_kem_ml_kem_512_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **);
@@ -629,18 +599,6 @@ int kex_kem_classic_mceliece_8192128_ecdh_nistp521_dec(struct kex *, const stru
629599
int kex_kem_classic_mceliece_8192128f_ecdh_nistp521_keypair(struct kex *);
630600
int kex_kem_classic_mceliece_8192128f_ecdh_nistp521_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **);
631601
int kex_kem_classic_mceliece_8192128f_ecdh_nistp521_dec(struct kex *, const struct sshbuf *, struct sshbuf **);
632-
/* hqc_128_nistp256 prototypes */
633-
int kex_kem_hqc_128_ecdh_nistp256_keypair(struct kex *);
634-
int kex_kem_hqc_128_ecdh_nistp256_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **);
635-
int kex_kem_hqc_128_ecdh_nistp256_dec(struct kex *, const struct sshbuf *, struct sshbuf **);
636-
/* hqc_192_nistp384 prototypes */
637-
int kex_kem_hqc_192_ecdh_nistp384_keypair(struct kex *);
638-
int kex_kem_hqc_192_ecdh_nistp384_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **);
639-
int kex_kem_hqc_192_ecdh_nistp384_dec(struct kex *, const struct sshbuf *, struct sshbuf **);
640-
/* hqc_256_nistp521 prototypes */
641-
int kex_kem_hqc_256_ecdh_nistp521_keypair(struct kex *);
642-
int kex_kem_hqc_256_ecdh_nistp521_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **);
643-
int kex_kem_hqc_256_ecdh_nistp521_dec(struct kex *, const struct sshbuf *, struct sshbuf **);
644602
/* ml_kem_512_nistp256 prototypes */
645603
int kex_kem_ml_kem_512_ecdh_nistp256_keypair(struct kex *);
646604
int kex_kem_ml_kem_512_ecdh_nistp256_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **);

kexgen.c

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -203,18 +203,6 @@ kex_gen_client(struct ssh *ssh)
203203
case KEX_KEM_CLASSIC_MCELIECE_8192128F_SHA512:
204204
r = kex_kem_classic_mceliece_8192128f_keypair(kex);
205205
break;
206-
case KEX_KEM_HQC_128_SHA256:
207-
r = kex_kem_hqc_128_keypair(kex);
208-
break;
209-
case KEX_KEM_HQC_128_X25519_SHA256:
210-
r = kex_kem_hqc_128_x25519_keypair(kex);
211-
break;
212-
case KEX_KEM_HQC_192_SHA384:
213-
r = kex_kem_hqc_192_keypair(kex);
214-
break;
215-
case KEX_KEM_HQC_256_SHA512:
216-
r = kex_kem_hqc_256_keypair(kex);
217-
break;
218206
case KEX_KEM_ML_KEM_512_SHA256:
219207
r = kex_kem_ml_kem_512_keypair(kex);
220208
break;
@@ -304,15 +292,6 @@ kex_gen_client(struct ssh *ssh)
304292
case KEX_KEM_CLASSIC_MCELIECE_8192128F_ECDH_NISTP521_SHA512:
305293
r = kex_kem_classic_mceliece_8192128f_ecdh_nistp521_keypair(kex);
306294
break;
307-
case KEX_KEM_HQC_128_ECDH_NISTP256_SHA256:
308-
r = kex_kem_hqc_128_ecdh_nistp256_keypair(kex);
309-
break;
310-
case KEX_KEM_HQC_192_ECDH_NISTP384_SHA384:
311-
r = kex_kem_hqc_192_ecdh_nistp384_keypair(kex);
312-
break;
313-
case KEX_KEM_HQC_256_ECDH_NISTP521_SHA512:
314-
r = kex_kem_hqc_256_ecdh_nistp521_keypair(kex);
315-
break;
316295
case KEX_KEM_ML_KEM_512_ECDH_NISTP256_SHA256:
317296
r = kex_kem_ml_kem_512_ecdh_nistp256_keypair(kex);
318297
break;
@@ -478,18 +457,6 @@ input_kex_gen_reply(int type, u_int32_t seq, struct ssh *ssh)
478457
case KEX_KEM_CLASSIC_MCELIECE_8192128F_SHA512:
479458
r = kex_kem_classic_mceliece_8192128f_dec(kex, server_blob, &shared_secret);
480459
break;
481-
case KEX_KEM_HQC_128_SHA256:
482-
r = kex_kem_hqc_128_dec(kex, server_blob, &shared_secret);
483-
break;
484-
case KEX_KEM_HQC_128_X25519_SHA256:
485-
r = kex_kem_hqc_128_x25519_dec(kex, server_blob, &shared_secret);
486-
break;
487-
case KEX_KEM_HQC_192_SHA384:
488-
r = kex_kem_hqc_192_dec(kex, server_blob, &shared_secret);
489-
break;
490-
case KEX_KEM_HQC_256_SHA512:
491-
r = kex_kem_hqc_256_dec(kex, server_blob, &shared_secret);
492-
break;
493460
case KEX_KEM_ML_KEM_512_SHA256:
494461
r = kex_kem_ml_kem_512_dec(kex, server_blob, &shared_secret);
495462
break;
@@ -579,15 +546,6 @@ input_kex_gen_reply(int type, u_int32_t seq, struct ssh *ssh)
579546
case KEX_KEM_CLASSIC_MCELIECE_8192128F_ECDH_NISTP521_SHA512:
580547
r = kex_kem_classic_mceliece_8192128f_ecdh_nistp521_dec(kex, server_blob, &shared_secret);
581548
break;
582-
case KEX_KEM_HQC_128_ECDH_NISTP256_SHA256:
583-
r = kex_kem_hqc_128_ecdh_nistp256_dec(kex, server_blob, &shared_secret);
584-
break;
585-
case KEX_KEM_HQC_192_ECDH_NISTP384_SHA384:
586-
r = kex_kem_hqc_192_ecdh_nistp384_dec(kex, server_blob, &shared_secret);
587-
break;
588-
case KEX_KEM_HQC_256_ECDH_NISTP521_SHA512:
589-
r = kex_kem_hqc_256_ecdh_nistp521_dec(kex, server_blob, &shared_secret);
590-
break;
591549
case KEX_KEM_ML_KEM_512_ECDH_NISTP256_SHA256:
592550
r = kex_kem_ml_kem_512_ecdh_nistp256_dec(kex, server_blob, &shared_secret);
593551
break;
@@ -832,22 +790,6 @@ input_kex_gen_init(int type, u_int32_t seq, struct ssh *ssh)
832790
r = kex_kem_classic_mceliece_8192128f_enc(kex, client_pubkey,
833791
&server_pubkey, &shared_secret);
834792
break;
835-
case KEX_KEM_HQC_128_SHA256:
836-
r = kex_kem_hqc_128_enc(kex, client_pubkey,
837-
&server_pubkey, &shared_secret);
838-
break;
839-
case KEX_KEM_HQC_128_X25519_SHA256:
840-
r = kex_kem_hqc_128_x25519_enc(kex, client_pubkey,
841-
&server_pubkey, &shared_secret);
842-
break;
843-
case KEX_KEM_HQC_192_SHA384:
844-
r = kex_kem_hqc_192_enc(kex, client_pubkey,
845-
&server_pubkey, &shared_secret);
846-
break;
847-
case KEX_KEM_HQC_256_SHA512:
848-
r = kex_kem_hqc_256_enc(kex, client_pubkey,
849-
&server_pubkey, &shared_secret);
850-
break;
851793
case KEX_KEM_ML_KEM_512_SHA256:
852794
r = kex_kem_ml_kem_512_enc(kex, client_pubkey,
853795
&server_pubkey, &shared_secret);
@@ -966,18 +908,6 @@ input_kex_gen_init(int type, u_int32_t seq, struct ssh *ssh)
966908
r = kex_kem_classic_mceliece_8192128f_ecdh_nistp521_enc(kex, client_pubkey,
967909
&server_pubkey, &shared_secret);
968910
break;
969-
case KEX_KEM_HQC_128_ECDH_NISTP256_SHA256:
970-
r = kex_kem_hqc_128_ecdh_nistp256_enc(kex, client_pubkey,
971-
&server_pubkey, &shared_secret);
972-
break;
973-
case KEX_KEM_HQC_192_ECDH_NISTP384_SHA384:
974-
r = kex_kem_hqc_192_ecdh_nistp384_enc(kex, client_pubkey,
975-
&server_pubkey, &shared_secret);
976-
break;
977-
case KEX_KEM_HQC_256_ECDH_NISTP521_SHA512:
978-
r = kex_kem_hqc_256_ecdh_nistp521_enc(kex, client_pubkey,
979-
&server_pubkey, &shared_secret);
980-
break;
981911
case KEX_KEM_ML_KEM_512_ECDH_NISTP256_SHA256:
982912
r = kex_kem_ml_kem_512_ecdh_nistp256_enc(kex, client_pubkey,
983913
&server_pubkey, &shared_secret);

kexoqs.c

Lines changed: 0 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,126 +1043,6 @@ int kex_kem_classic_mceliece_8192128f_dec(struct kex *kex,
10431043
OQS_KEM_free(kem);
10441044
return r;
10451045
}
1046-
/*---------------------------------------------------
1047-
* HQC_128 METHODS
1048-
*---------------------------------------------------
1049-
*/
1050-
int kex_kem_hqc_128_keypair(struct kex *kex)
1051-
{
1052-
OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_hqc_128);
1053-
if (kem == NULL) {
1054-
return SSH_ERR_ALLOC_FAIL;
1055-
}
1056-
int r = kex_kem_generic_keypair(kem, kex);
1057-
OQS_KEM_free(kem);
1058-
return r;
1059-
}
1060-
int kex_kem_hqc_128_enc(struct kex *kex,
1061-
const struct sshbuf *client_blob,
1062-
struct sshbuf **server_blobp,
1063-
struct sshbuf **shared_secretp)
1064-
{
1065-
OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_hqc_128);
1066-
if (kem == NULL) {
1067-
return SSH_ERR_ALLOC_FAIL;
1068-
}
1069-
int r = kex_kem_generic_enc(kem, kex, client_blob, server_blobp, shared_secretp);
1070-
OQS_KEM_free(kem);
1071-
return r;
1072-
}
1073-
1074-
int kex_kem_hqc_128_dec(struct kex *kex,
1075-
const struct sshbuf *server_blob,
1076-
struct sshbuf **shared_secretp)
1077-
{
1078-
OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_hqc_128);
1079-
if (kem == NULL) {
1080-
return SSH_ERR_ALLOC_FAIL;
1081-
}
1082-
int r = kex_kem_generic_dec(kem, kex, server_blob, shared_secretp);
1083-
OQS_KEM_free(kem);
1084-
return r;
1085-
}
1086-
/*---------------------------------------------------
1087-
* HQC_192 METHODS
1088-
*---------------------------------------------------
1089-
*/
1090-
int kex_kem_hqc_192_keypair(struct kex *kex)
1091-
{
1092-
OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_hqc_192);
1093-
if (kem == NULL) {
1094-
return SSH_ERR_ALLOC_FAIL;
1095-
}
1096-
int r = kex_kem_generic_keypair(kem, kex);
1097-
OQS_KEM_free(kem);
1098-
return r;
1099-
}
1100-
int kex_kem_hqc_192_enc(struct kex *kex,
1101-
const struct sshbuf *client_blob,
1102-
struct sshbuf **server_blobp,
1103-
struct sshbuf **shared_secretp)
1104-
{
1105-
OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_hqc_192);
1106-
if (kem == NULL) {
1107-
return SSH_ERR_ALLOC_FAIL;
1108-
}
1109-
int r = kex_kem_generic_enc(kem, kex, client_blob, server_blobp, shared_secretp);
1110-
OQS_KEM_free(kem);
1111-
return r;
1112-
}
1113-
1114-
int kex_kem_hqc_192_dec(struct kex *kex,
1115-
const struct sshbuf *server_blob,
1116-
struct sshbuf **shared_secretp)
1117-
{
1118-
OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_hqc_192);
1119-
if (kem == NULL) {
1120-
return SSH_ERR_ALLOC_FAIL;
1121-
}
1122-
int r = kex_kem_generic_dec(kem, kex, server_blob, shared_secretp);
1123-
OQS_KEM_free(kem);
1124-
return r;
1125-
}
1126-
/*---------------------------------------------------
1127-
* HQC_256 METHODS
1128-
*---------------------------------------------------
1129-
*/
1130-
int kex_kem_hqc_256_keypair(struct kex *kex)
1131-
{
1132-
OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_hqc_256);
1133-
if (kem == NULL) {
1134-
return SSH_ERR_ALLOC_FAIL;
1135-
}
1136-
int r = kex_kem_generic_keypair(kem, kex);
1137-
OQS_KEM_free(kem);
1138-
return r;
1139-
}
1140-
int kex_kem_hqc_256_enc(struct kex *kex,
1141-
const struct sshbuf *client_blob,
1142-
struct sshbuf **server_blobp,
1143-
struct sshbuf **shared_secretp)
1144-
{
1145-
OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_hqc_256);
1146-
if (kem == NULL) {
1147-
return SSH_ERR_ALLOC_FAIL;
1148-
}
1149-
int r = kex_kem_generic_enc(kem, kex, client_blob, server_blobp, shared_secretp);
1150-
OQS_KEM_free(kem);
1151-
return r;
1152-
}
1153-
1154-
int kex_kem_hqc_256_dec(struct kex *kex,
1155-
const struct sshbuf *server_blob,
1156-
struct sshbuf **shared_secretp)
1157-
{
1158-
OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_hqc_256);
1159-
if (kem == NULL) {
1160-
return SSH_ERR_ALLOC_FAIL;
1161-
}
1162-
int r = kex_kem_generic_dec(kem, kex, server_blob, shared_secretp);
1163-
OQS_KEM_free(kem);
1164-
return r;
1165-
}
11661046
/*---------------------------------------------------
11671047
* ML_KEM_512 METHODS
11681048
*---------------------------------------------------

0 commit comments

Comments
 (0)