From cbbb4b5b45fa2df058bd9143a171e3bacd412219 Mon Sep 17 00:00:00 2001 From: Michael Baentsch Date: Thu, 27 May 2021 18:02:29 +0200 Subject: [PATCH] Adding all algorithms (#97) * added all algorithms from current liboqs main * caveats for McEliece and Rainbow documented --- .circleci/config.yml | 8 +- README.md | 52 +- kex.c | 100 + kex.h | 600 +++++ kexgen.c | 1000 ++++++++ kexoqs.c | 2012 +++++++++++++++- kexoqsecdh.c | 2062 ++++++++++++++++- match.c | 2 +- monitor.c | 100 + myproposal.h | 102 +- oqs-template/README.md/list_all_kexs.fragment | 2 +- oqs-template/README.md/list_all_sigs.fragment | 2 +- oqs-template/generate.py | 13 +- oqs-template/generate.yml | 963 +++++++- oqs-test/try_connection.py | 167 +- oqs-utils.c | 24 +- oqs-utils.h | 25 +- packet.c | 3 +- pathnames.h | 50 +- readconf.c | 28 +- regress/keygen-comment.sh | 10 +- servconf.c | 40 +- sk-api.h | 29 +- ssh-add.c | 25 +- ssh-keygen.c | 181 +- ssh-keyscan.c | 286 ++- ssh-keysign.c | 27 +- ssh-oqs.c | 232 +- ssh-rsa.c | 5 +- ssh.c | 31 +- ssh_api.c | 200 ++ sshconnect2.c | 100 + sshd.c | 100 + sshkey.c | 300 ++- sshkey.h | 45 +- 35 files changed, 8655 insertions(+), 271 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c69f14f68f73..31a54735b6a7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -38,11 +38,11 @@ jobs: name: Build OpenSSH command: env WITH_OPENSSL=<< parameters.WITH_OPENSSL >> ./oqs-scripts/build_openssh.sh - run: - name: Run tests - command: ./oqs-test/run_tests.sh + name: Run short tests + command: make tests LTESTS="" - run: - name: Ensure we have the ssh and sshd syntax right - command: python3 oqs-test/try_connection.py + name: Ensure we have the ssh and sshd syntax right once for each algorithm + command: python3 oqs-test/try_connection.py doone workflows: version: 2.1 build: diff --git a/README.md b/README.md index 88c399830f70..ed681a257d2a 100644 --- a/README.md +++ b/README.md @@ -57,8 +57,16 @@ The following quantum-safe algorithms from liboqs are supported (assuming they h - `oqs-default-sha256` (see [here](https://github.com/open-quantum-safe/openssh-portable/wiki/Using-liboqs-supported-algorithms-in-the-fork) for what this denotes) -- **FrodoKEM**: `frodokem-640-aes-sha256`, `frodokem-976-aes-sha384`, `frodokem-1344-aes-sha512` -- **SIKE**: `sike-p434-sha256` +- **BIKE**: `bike1-l1-cpa-sha512`, `bike1-l1-fo-sha512`, `bike1-l3-cpa-sha512`, `bike1-l3-fo-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`, `kyber-512-90s-sha256`, `kyber-768-90s-sha384`, `kyber-1024-90s-sha512` +- **NTRU**: `ntru-hps2048509-sha512`, `ntru-hps2048677-sha512`, `ntru-hrss701-sha512`, `ntru-hps4096821-sha512` +- **NTRU-PRIME**: `ntruprime-ntrulpr653-sha256`, `ntruprime-sntrup653-sha256`, `ntruprime-ntrulpr761-sha384`, `ntruprime-sntrup761-sha384`, `ntruprime-ntrulpr857-sha384`, `ntruprime-sntrup857-sha384` +- **SIDH**: `sidh-p434-sha256`, `sidh-p434-compressed-sha256`, `sidh-p610-sha256`, `sidh-p610-compressed-sha256`, `sidh-p751-sha256`, `sidh-p751-compressed-sha256` +- **SIKE**: `sike-p434-sha256`, `sike-p434-compressed-sha256`, `sike-p610-sha256`, `sike-p610-compressed-sha256`, `sike-p751-sha256`, `sike-p751-compressed-sha256` +- **Saber**: `saber-lightsaber-sha256`, `saber-saber-sha384`, `saber-firesaber-sha512` For each `` listed above, the following hybrid algorithms are made available as follows: @@ -71,13 +79,18 @@ Note that algorithms marked with a dagger (†) have large stack usage and may c #### Digital Signature -The following digital signature algorithms from liboqs are supported (assuming they have been enabled in liboqs). Note that only L1 signature and all **Rainbow** variants are enabled by default, 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-for://github.com/open-quantum-safe/openssh/wiki/Using-liboqs-supported-algorithms-in-the-fork#code-generation). +The following digital signature algorithms from liboqs are supported (assuming they have been enabled in liboqs). Note that only select L3 signature variants are enabled by default, 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). Note that enabling Rainbow will introduce a substantial execution delay to all operations. If doing it inadvertently, tests will fail and all kind of headaches occur. You have been warned. - `oqsdefault` (see [here](https://github.com/open-quantum-safe/openssh-portable/wiki/Using-liboqs-supported-algorithms-in-the-fork) for what this denotes) -- **Dilithium**: `dilithium2`, `dilithium3`, `dilithium5` +- **Dilithium**: `dilithium2`, `dilithium3`*, `dilithium5`, `dilithium2aes`*, `dilithium3aes`, `dilithium5aes`* +- **Falcon**: `falcon512`*, `falcon1024`* +- **Picnic**: `picnicL1FS`, `picnicL1UR`, `picnicL1full`*, `picnicL3FS`*, `picnicL3UR`, `picnicL3full`, `picnicL5FS`, `picnicL5UR`, `picnicL5full` +- **Rainbow**: `rainbowIclassic`, `rainbowIcircumzenithal`, `rainbowIcompressed`, `rainbowIIIclassic`, `rainbowIIIcircumzenithal`, `rainbowIIIcompressed`, `rainbowVclassic`, `rainbowVcircumzenithal`, `rainbowVcompressed` +- **SPHINCS**: `sphincsharaka128frobust`, `sphincsharaka128fsimple`*, `sphincsharaka128srobust`, `sphincsharaka128ssimple`, `sphincssha256128frobust`, `sphincssha256128srobust`, `sphincssha256128fsimple`, `sphincssha256128ssimple`, `sphincsshake256128frobust`, `sphincsshake256128srobust`, `sphincsshake256128fsimple`, `sphincsshake256128ssimple`, `sphincsharaka192frobust`*, `sphincsharaka192srobust`, `sphincsharaka192fsimple`, `sphincsharaka192ssimple`, `sphincssha256192frobust`, `sphincssha256192srobust`, `sphincssha256192fsimple`, `sphincssha256192ssimple`, `sphincsshake256192frobust`, `sphincsshake256192srobust`, `sphincsshake256192fsimple`, `sphincsshake256192ssimple`, `sphincsharaka256frobust`, `sphincsharaka256srobust`, `sphincsharaka256fsimple`, `sphincsharaka256ssimple`, `sphincssha256256frobust`, `sphincssha256256srobust`, `sphincssha256256fsimple`, `sphincssha256256ssimple`, `sphincsshake256256frobust`, `sphincsshake256256srobust`, `sphincsshake256256fsimple`, `sphincsshake256256ssimple` + The following hybrid algorithms are supported; they combine a quantum-safe algorithm listed above with a traditional digital signature algorithm (`` is any one of the algorithms listed above): - if `` has L1 security, then the fork provides the methods `rsa3072-` and `ecdsa-nistp256-`, which combine `` with RSA3072 and with ECDSA using NIST's P256 curve respectively. @@ -86,7 +99,7 @@ The following hybrid algorithms are supported; they combine a quantum-safe algor ## Quickstart -The steps below have been confirmed to work on macOS 10.14 (clang 10.0.0) and Ubuntu 18.04.1 Bionic (gcc-7). +The steps below have been confirmed to work on Ubuntu 20.04.1 Focal ### Building OQS-OpenSSH @@ -131,7 +144,6 @@ Building liboqs requires your system to have OpenSSL 1.1.1 or higher already ins In ``, first run: ``` -export LIBOQS_INSTALL= export OPENSSH_INSTALL= autoreconf ``` @@ -143,25 +155,17 @@ Then, run the following: --with-libs=-lm \ --prefix=$OPENSSH_INSTALL \ --sysconfdir=$OPENSSH_INSTALL \ - --with-liboqs-dir=$LIBOQS_INSTALL - make -j + --with-liboqs-dir=`pwd`/oqs + make make install -To test the build, run: - - make tests +Again, the `path-to-openssl` (1.1.1) does not need to be specified if it is in one of the standard locations. -To run OQS-specific tests of all the post-quantum key-exchanges: +So, in summary, if OpenSSL is installed in a default location and `oqs-openssh` is to be installed in `/opt/openssh` this command builds and installs `oqs-openssh`: `export OPENSSH_INSTALL=/opt/openssh && autoreconf && ./configure --with-libs=-lm --prefix=$OPENSSH_INSTALL --sysconfdir=$OPENSSH_INSTALL --with-liboqs-dir=`pwd`/oqs && make && make install` -``` -python3 -m nose --rednose --verbose -``` +As not all stock `openssh` tests are passing, be sure to execute `oqs-test/run_tests.sh` instead of simply executing `make tests` to ensure the build was successful. -To run OQS-specific tests of all combinations of post-quantum key-exchange and authentication algorithms: - -``` -env WITH_PQAUTH=true python3 -m nose --rednose --verbose -``` +To execute a connection test with one of the supported quantum-safe algorithms (chosen at random), run `python3 oqs-test/try_connection.py`. If all algorithms should be exercized, pass a parameter to this command, e.g., like this: `python3 oqs-test/try_connection.py all`. Be aware that this test can take a long time due to the number of algorithm combinations available. ### Running OQS-OpenSSH @@ -197,7 +201,7 @@ In one terminal, run a server: -o AuthorizedKeysFile=/ssh_server/authorized_keys \ -o HostKeyAlgorithms=ssh- \ -o PubkeyAcceptedKeyTypes=ssh- \ - -h /ssh_server/id_] + -h /ssh_server/id_ `` and `` are respectively one of the key exchange and signature (PQ-only or hybrid) algorithms listed in the [Supported Algorithms](#supported-algorithms) section above. @@ -205,16 +209,17 @@ The `-o` options can also be added to the server/client configuration file inste The server automatically supports all available hybrid and PQ-only key exchange algorithms. `sudo` is required on Linux so that sshd can read the shadow password file. -In another terminal, run a client(the arguments between `[...]` can be omitted if only classical authentication is required): +In another terminal, run a client: /bin/ssh -p 2222 localhost \ -o KexAlgorithms= \ -o HostKeyAlgorithms=ssh-\ -o PubkeyAcceptedKeyTypes=ssh- \ -o StrictHostKeyChecking=no \ + -o PasswordAuthentication=no \ -i ~/ssh_client/id_ -The `StrictHostKeyChecking` option is used to allow trusting the newly generated server key; alternatively, the key could be added manually to the client's trusted keys. +The `StrictHostKeyChecking` option is used to allow trusting the newly generated server key; alternatively, the key could be added manually to the client's trusted keys. The `PasswordAuthentication` option is used to ensure the test server does not fall back to password authentication if public key authentication fails for some reason. ## Contributing @@ -236,6 +241,7 @@ Contributors to this fork of OpenSSH include: - Christian Paquin (Microsoft Research) - Douglas Stebila (University of Waterloo) - Goutam Tamvada (University of Waterloo) +- Michael Baentsch Contributors to an earlier OQS fork of OpenSSH included: diff --git a/kex.c b/kex.c index 4c281358d8e2..bec8d30c4b1b 100644 --- a/kex.c +++ b/kex.c @@ -120,13 +120,113 @@ static const struct kexalg kexalgs[] = { { KEX_FRODOKEM_640_AES_SHA256, KEX_KEM_FRODOKEM_640_AES_SHA256, 0, SSH_DIGEST_SHA256 }, { KEX_FRODOKEM_976_AES_SHA384, KEX_KEM_FRODOKEM_976_AES_SHA384, 0, SSH_DIGEST_SHA384 }, { KEX_FRODOKEM_1344_AES_SHA512, KEX_KEM_FRODOKEM_1344_AES_SHA512, 0, SSH_DIGEST_SHA512 }, + { KEX_FRODOKEM_640_SHAKE_SHA256, KEX_KEM_FRODOKEM_640_SHAKE_SHA256, 0, SSH_DIGEST_SHA256 }, + { KEX_FRODOKEM_976_SHAKE_SHA384, KEX_KEM_FRODOKEM_976_SHAKE_SHA384, 0, SSH_DIGEST_SHA384 }, + { KEX_FRODOKEM_1344_SHAKE_SHA512, KEX_KEM_FRODOKEM_1344_SHAKE_SHA512, 0, SSH_DIGEST_SHA512 }, + { KEX_SIDH_P434_SHA256, KEX_KEM_SIDH_P434_SHA256, 0, SSH_DIGEST_SHA256 }, + { KEX_SIDH_P434_COMPRESSED_SHA256, KEX_KEM_SIDH_P434_COMPRESSED_SHA256, 0, SSH_DIGEST_SHA256 }, + { KEX_SIDH_P610_SHA256, KEX_KEM_SIDH_P610_SHA256, 0, SSH_DIGEST_SHA256 }, + { KEX_SIDH_P610_COMPRESSED_SHA256, KEX_KEM_SIDH_P610_COMPRESSED_SHA256, 0, SSH_DIGEST_SHA256 }, + { KEX_SIDH_P751_SHA256, KEX_KEM_SIDH_P751_SHA256, 0, SSH_DIGEST_SHA256 }, + { KEX_SIDH_P751_COMPRESSED_SHA256, KEX_KEM_SIDH_P751_COMPRESSED_SHA256, 0, SSH_DIGEST_SHA256 }, { KEX_SIKE_P434_SHA256, KEX_KEM_SIKE_P434_SHA256, 0, SSH_DIGEST_SHA256 }, + { KEX_SIKE_P434_COMPRESSED_SHA256, KEX_KEM_SIKE_P434_COMPRESSED_SHA256, 0, SSH_DIGEST_SHA256 }, + { KEX_SIKE_P610_SHA256, KEX_KEM_SIKE_P610_SHA256, 0, SSH_DIGEST_SHA256 }, + { KEX_SIKE_P610_COMPRESSED_SHA256, KEX_KEM_SIKE_P610_COMPRESSED_SHA256, 0, SSH_DIGEST_SHA256 }, + { KEX_SIKE_P751_SHA256, KEX_KEM_SIKE_P751_SHA256, 0, SSH_DIGEST_SHA256 }, + { KEX_SIKE_P751_COMPRESSED_SHA256, KEX_KEM_SIKE_P751_COMPRESSED_SHA256, 0, SSH_DIGEST_SHA256 }, + { KEX_SABER_LIGHTSABER_SHA256, KEX_KEM_SABER_LIGHTSABER_SHA256, 0, SSH_DIGEST_SHA256 }, + { KEX_SABER_SABER_SHA384, KEX_KEM_SABER_SABER_SHA384, 0, SSH_DIGEST_SHA384 }, + { KEX_SABER_FIRESABER_SHA512, KEX_KEM_SABER_FIRESABER_SHA512, 0, SSH_DIGEST_SHA512 }, + { KEX_KYBER_512_SHA256, KEX_KEM_KYBER_512_SHA256, 0, SSH_DIGEST_SHA256 }, + { KEX_KYBER_768_SHA384, KEX_KEM_KYBER_768_SHA384, 0, SSH_DIGEST_SHA384 }, + { KEX_KYBER_1024_SHA512, KEX_KEM_KYBER_1024_SHA512, 0, SSH_DIGEST_SHA512 }, + { KEX_KYBER_512_90S_SHA256, KEX_KEM_KYBER_512_90S_SHA256, 0, SSH_DIGEST_SHA256 }, + { KEX_KYBER_768_90S_SHA384, KEX_KEM_KYBER_768_90S_SHA384, 0, SSH_DIGEST_SHA384 }, + { KEX_KYBER_1024_90S_SHA512, KEX_KEM_KYBER_1024_90S_SHA512, 0, SSH_DIGEST_SHA512 }, + { KEX_BIKE1_L1_CPA_SHA512, KEX_KEM_BIKE1_L1_CPA_SHA512, 0, SSH_DIGEST_SHA512 }, + { KEX_BIKE1_L1_FO_SHA512, KEX_KEM_BIKE1_L1_FO_SHA512, 0, SSH_DIGEST_SHA512 }, + { KEX_BIKE1_L3_CPA_SHA512, KEX_KEM_BIKE1_L3_CPA_SHA512, 0, SSH_DIGEST_SHA512 }, + { KEX_BIKE1_L3_FO_SHA512, KEX_KEM_BIKE1_L3_FO_SHA512, 0, SSH_DIGEST_SHA512 }, + { KEX_NTRU_HPS2048509_SHA512, KEX_KEM_NTRU_HPS2048509_SHA512, 0, SSH_DIGEST_SHA512 }, + { KEX_NTRU_HPS2048677_SHA512, KEX_KEM_NTRU_HPS2048677_SHA512, 0, SSH_DIGEST_SHA512 }, + { KEX_NTRU_HRSS701_SHA512, KEX_KEM_NTRU_HRSS701_SHA512, 0, SSH_DIGEST_SHA512 }, + { KEX_NTRU_HPS4096821_SHA512, KEX_KEM_NTRU_HPS4096821_SHA512, 0, SSH_DIGEST_SHA512 }, + { KEX_CLASSIC_MCELIECE_348864_SHA256, KEX_KEM_CLASSIC_MCELIECE_348864_SHA256, 0, SSH_DIGEST_SHA256 }, + { KEX_CLASSIC_MCELIECE_348864F_SHA256, KEX_KEM_CLASSIC_MCELIECE_348864F_SHA256, 0, SSH_DIGEST_SHA256 }, + { KEX_CLASSIC_MCELIECE_460896_SHA512, KEX_KEM_CLASSIC_MCELIECE_460896_SHA512, 0, SSH_DIGEST_SHA512 }, + { KEX_CLASSIC_MCELIECE_460896F_SHA512, KEX_KEM_CLASSIC_MCELIECE_460896F_SHA512, 0, SSH_DIGEST_SHA512 }, + { KEX_CLASSIC_MCELIECE_6688128_SHA512, KEX_KEM_CLASSIC_MCELIECE_6688128_SHA512, 0, SSH_DIGEST_SHA512 }, + { KEX_CLASSIC_MCELIECE_6688128F_SHA512, KEX_KEM_CLASSIC_MCELIECE_6688128F_SHA512, 0, SSH_DIGEST_SHA512 }, + { KEX_CLASSIC_MCELIECE_6960119_SHA512, KEX_KEM_CLASSIC_MCELIECE_6960119_SHA512, 0, SSH_DIGEST_SHA512 }, + { 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_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_NTRUPRIME_NTRULPR653_SHA256, KEX_KEM_NTRUPRIME_NTRULPR653_SHA256, 0, SSH_DIGEST_SHA256 }, + { KEX_NTRUPRIME_SNTRUP653_SHA256, KEX_KEM_NTRUPRIME_SNTRUP653_SHA256, 0, SSH_DIGEST_SHA256 }, + { KEX_NTRUPRIME_NTRULPR761_SHA384, KEX_KEM_NTRUPRIME_NTRULPR761_SHA384, 0, SSH_DIGEST_SHA384 }, + { KEX_NTRUPRIME_SNTRUP761_SHA384, KEX_KEM_NTRUPRIME_SNTRUP761_SHA384, 0, SSH_DIGEST_SHA384 }, + { KEX_NTRUPRIME_NTRULPR857_SHA384, KEX_KEM_NTRUPRIME_NTRULPR857_SHA384, 0, SSH_DIGEST_SHA384 }, + { KEX_NTRUPRIME_SNTRUP857_SHA384, KEX_KEM_NTRUPRIME_SNTRUP857_SHA384, 0, SSH_DIGEST_SHA384 }, #ifdef OPENSSL_HAS_ECC { KEX_OQS_DEFAULT_ECDH_NISTP256_SHA256, KEX_KEM_OQS_DEFAULT_ECDH_NISTP256_SHA256, NID_X9_62_prime256v1, SSH_DIGEST_SHA256 }, { KEX_FRODOKEM_640_AES_ECDH_NISTP256_SHA256, KEX_KEM_FRODOKEM_640_AES_ECDH_NISTP256_SHA256, NID_X9_62_prime256v1, SSH_DIGEST_SHA256 }, { KEX_FRODOKEM_976_AES_ECDH_NISTP384_SHA384, KEX_KEM_FRODOKEM_976_AES_ECDH_NISTP384_SHA384, NID_secp384r1, SSH_DIGEST_SHA384 }, { KEX_FRODOKEM_1344_AES_ECDH_NISTP521_SHA512, KEX_KEM_FRODOKEM_1344_AES_ECDH_NISTP521_SHA512, NID_secp521r1, SSH_DIGEST_SHA512 }, + { KEX_FRODOKEM_640_SHAKE_ECDH_NISTP256_SHA256, KEX_KEM_FRODOKEM_640_SHAKE_ECDH_NISTP256_SHA256, NID_X9_62_prime256v1, SSH_DIGEST_SHA256 }, + { KEX_FRODOKEM_976_SHAKE_ECDH_NISTP384_SHA384, KEX_KEM_FRODOKEM_976_SHAKE_ECDH_NISTP384_SHA384, NID_secp384r1, SSH_DIGEST_SHA384 }, + { KEX_FRODOKEM_1344_SHAKE_ECDH_NISTP521_SHA512, KEX_KEM_FRODOKEM_1344_SHAKE_ECDH_NISTP521_SHA512, NID_secp521r1, SSH_DIGEST_SHA512 }, + { KEX_SIDH_P434_ECDH_NISTP256_SHA256, KEX_KEM_SIDH_P434_ECDH_NISTP256_SHA256, NID_X9_62_prime256v1, SSH_DIGEST_SHA256 }, + { KEX_SIDH_P434_COMPRESSED_ECDH_NISTP256_SHA256, KEX_KEM_SIDH_P434_COMPRESSED_ECDH_NISTP256_SHA256, NID_X9_62_prime256v1, SSH_DIGEST_SHA256 }, + { KEX_SIDH_P610_ECDH_NISTP384_SHA256, KEX_KEM_SIDH_P610_ECDH_NISTP384_SHA256, NID_secp384r1, SSH_DIGEST_SHA256 }, + { KEX_SIDH_P610_COMPRESSED_ECDH_NISTP384_SHA256, KEX_KEM_SIDH_P610_COMPRESSED_ECDH_NISTP384_SHA256, NID_secp384r1, SSH_DIGEST_SHA256 }, + { KEX_SIDH_P751_ECDH_NISTP521_SHA256, KEX_KEM_SIDH_P751_ECDH_NISTP521_SHA256, NID_secp521r1, SSH_DIGEST_SHA256 }, + { KEX_SIDH_P751_COMPRESSED_ECDH_NISTP521_SHA256, KEX_KEM_SIDH_P751_COMPRESSED_ECDH_NISTP521_SHA256, NID_secp521r1, SSH_DIGEST_SHA256 }, { KEX_SIKE_P434_ECDH_NISTP256_SHA256, KEX_KEM_SIKE_P434_ECDH_NISTP256_SHA256, NID_X9_62_prime256v1, SSH_DIGEST_SHA256 }, + { KEX_SIKE_P434_COMPRESSED_ECDH_NISTP256_SHA256, KEX_KEM_SIKE_P434_COMPRESSED_ECDH_NISTP256_SHA256, NID_X9_62_prime256v1, SSH_DIGEST_SHA256 }, + { KEX_SIKE_P610_ECDH_NISTP384_SHA256, KEX_KEM_SIKE_P610_ECDH_NISTP384_SHA256, NID_secp384r1, SSH_DIGEST_SHA256 }, + { KEX_SIKE_P610_COMPRESSED_ECDH_NISTP384_SHA256, KEX_KEM_SIKE_P610_COMPRESSED_ECDH_NISTP384_SHA256, NID_secp384r1, SSH_DIGEST_SHA256 }, + { KEX_SIKE_P751_ECDH_NISTP521_SHA256, KEX_KEM_SIKE_P751_ECDH_NISTP521_SHA256, NID_secp521r1, SSH_DIGEST_SHA256 }, + { KEX_SIKE_P751_COMPRESSED_ECDH_NISTP521_SHA256, KEX_KEM_SIKE_P751_COMPRESSED_ECDH_NISTP521_SHA256, NID_secp521r1, SSH_DIGEST_SHA256 }, + { KEX_SABER_LIGHTSABER_ECDH_NISTP256_SHA256, KEX_KEM_SABER_LIGHTSABER_ECDH_NISTP256_SHA256, NID_X9_62_prime256v1, SSH_DIGEST_SHA256 }, + { KEX_SABER_SABER_ECDH_NISTP384_SHA384, KEX_KEM_SABER_SABER_ECDH_NISTP384_SHA384, NID_secp384r1, SSH_DIGEST_SHA384 }, + { KEX_SABER_FIRESABER_ECDH_NISTP521_SHA512, KEX_KEM_SABER_FIRESABER_ECDH_NISTP521_SHA512, NID_secp521r1, SSH_DIGEST_SHA512 }, + { KEX_KYBER_512_ECDH_NISTP256_SHA256, KEX_KEM_KYBER_512_ECDH_NISTP256_SHA256, NID_X9_62_prime256v1, SSH_DIGEST_SHA256 }, + { KEX_KYBER_768_ECDH_NISTP384_SHA384, KEX_KEM_KYBER_768_ECDH_NISTP384_SHA384, NID_secp384r1, SSH_DIGEST_SHA384 }, + { KEX_KYBER_1024_ECDH_NISTP521_SHA512, KEX_KEM_KYBER_1024_ECDH_NISTP521_SHA512, NID_secp521r1, SSH_DIGEST_SHA512 }, + { KEX_KYBER_512_90S_ECDH_NISTP256_SHA256, KEX_KEM_KYBER_512_90S_ECDH_NISTP256_SHA256, NID_X9_62_prime256v1, SSH_DIGEST_SHA256 }, + { KEX_KYBER_768_90S_ECDH_NISTP384_SHA384, KEX_KEM_KYBER_768_90S_ECDH_NISTP384_SHA384, NID_secp384r1, SSH_DIGEST_SHA384 }, + { KEX_KYBER_1024_90S_ECDH_NISTP521_SHA512, KEX_KEM_KYBER_1024_90S_ECDH_NISTP521_SHA512, NID_secp521r1, SSH_DIGEST_SHA512 }, + { KEX_BIKE1_L1_CPA_ECDH_NISTP256_SHA512, KEX_KEM_BIKE1_L1_CPA_ECDH_NISTP256_SHA512, NID_X9_62_prime256v1, SSH_DIGEST_SHA512 }, + { KEX_BIKE1_L1_FO_ECDH_NISTP256_SHA512, KEX_KEM_BIKE1_L1_FO_ECDH_NISTP256_SHA512, NID_X9_62_prime256v1, SSH_DIGEST_SHA512 }, + { KEX_BIKE1_L3_CPA_ECDH_NISTP384_SHA512, KEX_KEM_BIKE1_L3_CPA_ECDH_NISTP384_SHA512, NID_secp384r1, SSH_DIGEST_SHA512 }, + { KEX_BIKE1_L3_FO_ECDH_NISTP384_SHA512, KEX_KEM_BIKE1_L3_FO_ECDH_NISTP384_SHA512, NID_secp384r1, SSH_DIGEST_SHA512 }, + { KEX_NTRU_HPS2048509_ECDH_NISTP256_SHA512, KEX_KEM_NTRU_HPS2048509_ECDH_NISTP256_SHA512, NID_X9_62_prime256v1, SSH_DIGEST_SHA512 }, + { KEX_NTRU_HPS2048677_ECDH_NISTP384_SHA512, KEX_KEM_NTRU_HPS2048677_ECDH_NISTP384_SHA512, NID_secp384r1, SSH_DIGEST_SHA512 }, + { KEX_NTRU_HRSS701_ECDH_NISTP384_SHA512, KEX_KEM_NTRU_HRSS701_ECDH_NISTP384_SHA512, NID_secp384r1, SSH_DIGEST_SHA512 }, + { KEX_NTRU_HPS4096821_ECDH_NISTP521_SHA512, KEX_KEM_NTRU_HPS4096821_ECDH_NISTP521_SHA512, NID_secp521r1, SSH_DIGEST_SHA512 }, + { KEX_CLASSIC_MCELIECE_348864_ECDH_NISTP256_SHA256, KEX_KEM_CLASSIC_MCELIECE_348864_ECDH_NISTP256_SHA256, NID_X9_62_prime256v1, SSH_DIGEST_SHA256 }, + { KEX_CLASSIC_MCELIECE_348864F_ECDH_NISTP256_SHA256, KEX_KEM_CLASSIC_MCELIECE_348864F_ECDH_NISTP256_SHA256, NID_X9_62_prime256v1, SSH_DIGEST_SHA256 }, + { KEX_CLASSIC_MCELIECE_460896_ECDH_NISTP384_SHA512, KEX_KEM_CLASSIC_MCELIECE_460896_ECDH_NISTP384_SHA512, NID_secp384r1, SSH_DIGEST_SHA512 }, + { KEX_CLASSIC_MCELIECE_460896F_ECDH_NISTP384_SHA512, KEX_KEM_CLASSIC_MCELIECE_460896F_ECDH_NISTP384_SHA512, NID_secp384r1, SSH_DIGEST_SHA512 }, + { KEX_CLASSIC_MCELIECE_6688128_ECDH_NISTP521_SHA512, KEX_KEM_CLASSIC_MCELIECE_6688128_ECDH_NISTP521_SHA512, NID_secp521r1, SSH_DIGEST_SHA512 }, + { KEX_CLASSIC_MCELIECE_6688128F_ECDH_NISTP521_SHA512, KEX_KEM_CLASSIC_MCELIECE_6688128F_ECDH_NISTP521_SHA512, NID_secp521r1, SSH_DIGEST_SHA512 }, + { KEX_CLASSIC_MCELIECE_6960119_ECDH_NISTP521_SHA512, KEX_KEM_CLASSIC_MCELIECE_6960119_ECDH_NISTP521_SHA512, NID_secp521r1, SSH_DIGEST_SHA512 }, + { 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_NTRUPRIME_NTRULPR653_ECDH_NISTP256_SHA256, KEX_KEM_NTRUPRIME_NTRULPR653_ECDH_NISTP256_SHA256, NID_X9_62_prime256v1, SSH_DIGEST_SHA256 }, + { KEX_NTRUPRIME_SNTRUP653_ECDH_NISTP256_SHA256, KEX_KEM_NTRUPRIME_SNTRUP653_ECDH_NISTP256_SHA256, NID_X9_62_prime256v1, SSH_DIGEST_SHA256 }, + { KEX_NTRUPRIME_NTRULPR761_ECDH_NISTP384_SHA384, KEX_KEM_NTRUPRIME_NTRULPR761_ECDH_NISTP384_SHA384, NID_secp384r1, SSH_DIGEST_SHA384 }, + { KEX_NTRUPRIME_SNTRUP761_ECDH_NISTP384_SHA384, KEX_KEM_NTRUPRIME_SNTRUP761_ECDH_NISTP384_SHA384, NID_secp384r1, SSH_DIGEST_SHA384 }, + { KEX_NTRUPRIME_NTRULPR857_ECDH_NISTP384_SHA384, KEX_KEM_NTRUPRIME_NTRULPR857_ECDH_NISTP384_SHA384, NID_secp384r1, SSH_DIGEST_SHA384 }, + { KEX_NTRUPRIME_SNTRUP857_ECDH_NISTP384_SHA384, KEX_KEM_NTRUPRIME_SNTRUP857_ECDH_NISTP384_SHA384, NID_secp384r1, SSH_DIGEST_SHA384 }, #endif /* OPENSSL_HAS_ECC */ ///// OQS_TEMPLATE_FRAGMENT_ADD_KEX_ALGS_END diff --git a/kex.h b/kex.h index c7c6c6d4ecb1..77a528b519b9 100644 --- a/kex.h +++ b/kex.h @@ -69,14 +69,114 @@ #define KEX_FRODOKEM_640_AES_SHA256 "frodokem-640-aes-sha256" #define KEX_FRODOKEM_976_AES_SHA384 "frodokem-976-aes-sha384" #define KEX_FRODOKEM_1344_AES_SHA512 "frodokem-1344-aes-sha512" +#define KEX_FRODOKEM_640_SHAKE_SHA256 "frodokem-640-shake-sha256" +#define KEX_FRODOKEM_976_SHAKE_SHA384 "frodokem-976-shake-sha384" +#define KEX_FRODOKEM_1344_SHAKE_SHA512 "frodokem-1344-shake-sha512" +#define KEX_SIDH_P434_SHA256 "sidh-p434-sha256" +#define KEX_SIDH_P434_COMPRESSED_SHA256 "sidh-p434-compressed-sha256" +#define KEX_SIDH_P610_SHA256 "sidh-p610-sha256" +#define KEX_SIDH_P610_COMPRESSED_SHA256 "sidh-p610-compressed-sha256" +#define KEX_SIDH_P751_SHA256 "sidh-p751-sha256" +#define KEX_SIDH_P751_COMPRESSED_SHA256 "sidh-p751-compressed-sha256" #define KEX_SIKE_P434_SHA256 "sike-p434-sha256" +#define KEX_SIKE_P434_COMPRESSED_SHA256 "sike-p434-compressed-sha256" +#define KEX_SIKE_P610_SHA256 "sike-p610-sha256" +#define KEX_SIKE_P610_COMPRESSED_SHA256 "sike-p610-compressed-sha256" +#define KEX_SIKE_P751_SHA256 "sike-p751-sha256" +#define KEX_SIKE_P751_COMPRESSED_SHA256 "sike-p751-compressed-sha256" +#define KEX_SABER_LIGHTSABER_SHA256 "saber-lightsaber-sha256" +#define KEX_SABER_SABER_SHA384 "saber-saber-sha384" +#define KEX_SABER_FIRESABER_SHA512 "saber-firesaber-sha512" +#define KEX_KYBER_512_SHA256 "kyber-512-sha256" +#define KEX_KYBER_768_SHA384 "kyber-768-sha384" +#define KEX_KYBER_1024_SHA512 "kyber-1024-sha512" +#define KEX_KYBER_512_90S_SHA256 "kyber-512-90s-sha256" +#define KEX_KYBER_768_90S_SHA384 "kyber-768-90s-sha384" +#define KEX_KYBER_1024_90S_SHA512 "kyber-1024-90s-sha512" +#define KEX_BIKE1_L1_CPA_SHA512 "bike1-l1-cpa-sha512" +#define KEX_BIKE1_L1_FO_SHA512 "bike1-l1-fo-sha512" +#define KEX_BIKE1_L3_CPA_SHA512 "bike1-l3-cpa-sha512" +#define KEX_BIKE1_L3_FO_SHA512 "bike1-l3-fo-sha512" +#define KEX_NTRU_HPS2048509_SHA512 "ntru-hps2048509-sha512" +#define KEX_NTRU_HPS2048677_SHA512 "ntru-hps2048677-sha512" +#define KEX_NTRU_HRSS701_SHA512 "ntru-hrss701-sha512" +#define KEX_NTRU_HPS4096821_SHA512 "ntru-hps4096821-sha512" +#define KEX_CLASSIC_MCELIECE_348864_SHA256 "classic-mceliece-348864-sha256" +#define KEX_CLASSIC_MCELIECE_348864F_SHA256 "classic-mceliece-348864f-sha256" +#define KEX_CLASSIC_MCELIECE_460896_SHA512 "classic-mceliece-460896-sha512" +#define KEX_CLASSIC_MCELIECE_460896F_SHA512 "classic-mceliece-460896f-sha512" +#define KEX_CLASSIC_MCELIECE_6688128_SHA512 "classic-mceliece-6688128-sha512" +#define KEX_CLASSIC_MCELIECE_6688128F_SHA512 "classic-mceliece-6688128f-sha512" +#define KEX_CLASSIC_MCELIECE_6960119_SHA512 "classic-mceliece-6960119-sha512" +#define KEX_CLASSIC_MCELIECE_6960119F_SHA512 "classic-mceliece-6960119f-sha512" +#define KEX_CLASSIC_MCELIECE_8192128_SHA512 "classic-mceliece-8192128-sha512" +#define KEX_CLASSIC_MCELIECE_8192128F_SHA512 "classic-mceliece-8192128f-sha512" +#define KEX_HQC_128_SHA256 "hqc-128-sha256" +#define KEX_HQC_192_SHA384 "hqc-192-sha384" +#define KEX_HQC_256_SHA512 "hqc-256-sha512" +#define KEX_NTRUPRIME_NTRULPR653_SHA256 "ntruprime-ntrulpr653-sha256" +#define KEX_NTRUPRIME_SNTRUP653_SHA256 "ntruprime-sntrup653-sha256" +#define KEX_NTRUPRIME_NTRULPR761_SHA384 "ntruprime-ntrulpr761-sha384" +#define KEX_NTRUPRIME_SNTRUP761_SHA384 "ntruprime-sntrup761-sha384" +#define KEX_NTRUPRIME_NTRULPR857_SHA384 "ntruprime-ntrulpr857-sha384" +#define KEX_NTRUPRIME_SNTRUP857_SHA384 "ntruprime-sntrup857-sha384" #ifdef WITH_OPENSSL #ifdef OPENSSL_HAS_ECC #define KEX_OQS_DEFAULT_ECDH_NISTP256_SHA256 "ecdh-nistp256-oqs-default-sha256" #define KEX_FRODOKEM_640_AES_ECDH_NISTP256_SHA256 "ecdh-nistp256-frodokem-640-aes-sha256" #define KEX_FRODOKEM_976_AES_ECDH_NISTP384_SHA384 "ecdh-nistp384-frodokem-976-aes-sha384" #define KEX_FRODOKEM_1344_AES_ECDH_NISTP521_SHA512 "ecdh-nistp521-frodokem-1344-aes-sha512" +#define KEX_FRODOKEM_640_SHAKE_ECDH_NISTP256_SHA256 "ecdh-nistp256-frodokem-640-shake-sha256" +#define KEX_FRODOKEM_976_SHAKE_ECDH_NISTP384_SHA384 "ecdh-nistp384-frodokem-976-shake-sha384" +#define KEX_FRODOKEM_1344_SHAKE_ECDH_NISTP521_SHA512 "ecdh-nistp521-frodokem-1344-shake-sha512" +#define KEX_SIDH_P434_ECDH_NISTP256_SHA256 "ecdh-nistp256-sidh-p434-sha256" +#define KEX_SIDH_P434_COMPRESSED_ECDH_NISTP256_SHA256 "ecdh-nistp256-sidh-p434-compressed-sha256" +#define KEX_SIDH_P610_ECDH_NISTP384_SHA256 "ecdh-nistp384-sidh-p610-sha256" +#define KEX_SIDH_P610_COMPRESSED_ECDH_NISTP384_SHA256 "ecdh-nistp384-sidh-p610-compressed-sha256" +#define KEX_SIDH_P751_ECDH_NISTP521_SHA256 "ecdh-nistp521-sidh-p751-sha256" +#define KEX_SIDH_P751_COMPRESSED_ECDH_NISTP521_SHA256 "ecdh-nistp521-sidh-p751-compressed-sha256" #define KEX_SIKE_P434_ECDH_NISTP256_SHA256 "ecdh-nistp256-sike-p434-sha256" +#define KEX_SIKE_P434_COMPRESSED_ECDH_NISTP256_SHA256 "ecdh-nistp256-sike-p434-compressed-sha256" +#define KEX_SIKE_P610_ECDH_NISTP384_SHA256 "ecdh-nistp384-sike-p610-sha256" +#define KEX_SIKE_P610_COMPRESSED_ECDH_NISTP384_SHA256 "ecdh-nistp384-sike-p610-compressed-sha256" +#define KEX_SIKE_P751_ECDH_NISTP521_SHA256 "ecdh-nistp521-sike-p751-sha256" +#define KEX_SIKE_P751_COMPRESSED_ECDH_NISTP521_SHA256 "ecdh-nistp521-sike-p751-compressed-sha256" +#define KEX_SABER_LIGHTSABER_ECDH_NISTP256_SHA256 "ecdh-nistp256-saber-lightsaber-sha256" +#define KEX_SABER_SABER_ECDH_NISTP384_SHA384 "ecdh-nistp384-saber-saber-sha384" +#define KEX_SABER_FIRESABER_ECDH_NISTP521_SHA512 "ecdh-nistp521-saber-firesaber-sha512" +#define KEX_KYBER_512_ECDH_NISTP256_SHA256 "ecdh-nistp256-kyber-512-sha256" +#define KEX_KYBER_768_ECDH_NISTP384_SHA384 "ecdh-nistp384-kyber-768-sha384" +#define KEX_KYBER_1024_ECDH_NISTP521_SHA512 "ecdh-nistp521-kyber-1024-sha512" +#define KEX_KYBER_512_90S_ECDH_NISTP256_SHA256 "ecdh-nistp256-kyber-512-90s-sha256" +#define KEX_KYBER_768_90S_ECDH_NISTP384_SHA384 "ecdh-nistp384-kyber-768-90s-sha384" +#define KEX_KYBER_1024_90S_ECDH_NISTP521_SHA512 "ecdh-nistp521-kyber-1024-90s-sha512" +#define KEX_BIKE1_L1_CPA_ECDH_NISTP256_SHA512 "ecdh-nistp256-bike1-l1-cpa-sha512" +#define KEX_BIKE1_L1_FO_ECDH_NISTP256_SHA512 "ecdh-nistp256-bike1-l1-fo-sha512" +#define KEX_BIKE1_L3_CPA_ECDH_NISTP384_SHA512 "ecdh-nistp384-bike1-l3-cpa-sha512" +#define KEX_BIKE1_L3_FO_ECDH_NISTP384_SHA512 "ecdh-nistp384-bike1-l3-fo-sha512" +#define KEX_NTRU_HPS2048509_ECDH_NISTP256_SHA512 "ecdh-nistp256-ntru-hps2048509-sha512" +#define KEX_NTRU_HPS2048677_ECDH_NISTP384_SHA512 "ecdh-nistp384-ntru-hps2048677-sha512" +#define KEX_NTRU_HRSS701_ECDH_NISTP384_SHA512 "ecdh-nistp384-ntru-hrss701-sha512" +#define KEX_NTRU_HPS4096821_ECDH_NISTP521_SHA512 "ecdh-nistp521-ntru-hps4096821-sha512" +#define KEX_CLASSIC_MCELIECE_348864_ECDH_NISTP256_SHA256 "ecdh-nistp256-classic-mceliece-348864-sha256" +#define KEX_CLASSIC_MCELIECE_348864F_ECDH_NISTP256_SHA256 "ecdh-nistp256-classic-mceliece-348864f-sha256" +#define KEX_CLASSIC_MCELIECE_460896_ECDH_NISTP384_SHA512 "ecdh-nistp384-classic-mceliece-460896-sha512" +#define KEX_CLASSIC_MCELIECE_460896F_ECDH_NISTP384_SHA512 "ecdh-nistp384-classic-mceliece-460896f-sha512" +#define KEX_CLASSIC_MCELIECE_6688128_ECDH_NISTP521_SHA512 "ecdh-nistp521-classic-mceliece-6688128-sha512" +#define KEX_CLASSIC_MCELIECE_6688128F_ECDH_NISTP521_SHA512 "ecdh-nistp521-classic-mceliece-6688128f-sha512" +#define KEX_CLASSIC_MCELIECE_6960119_ECDH_NISTP521_SHA512 "ecdh-nistp521-classic-mceliece-6960119-sha512" +#define KEX_CLASSIC_MCELIECE_6960119F_ECDH_NISTP521_SHA512 "ecdh-nistp521-classic-mceliece-6960119f-sha512" +#define KEX_CLASSIC_MCELIECE_8192128_ECDH_NISTP521_SHA512 "ecdh-nistp521-classic-mceliece-8192128-sha512" +#define KEX_CLASSIC_MCELIECE_8192128F_ECDH_NISTP521_SHA512 "ecdh-nistp521-classic-mceliece-8192128f-sha512" +#define KEX_HQC_128_ECDH_NISTP256_SHA256 "ecdh-nistp256-hqc-128-sha256" +#define KEX_HQC_192_ECDH_NISTP384_SHA384 "ecdh-nistp384-hqc-192-sha384" +#define KEX_HQC_256_ECDH_NISTP521_SHA512 "ecdh-nistp521-hqc-256-sha512" +#define KEX_NTRUPRIME_NTRULPR653_ECDH_NISTP256_SHA256 "ecdh-nistp256-ntruprime-ntrulpr653-sha256" +#define KEX_NTRUPRIME_SNTRUP653_ECDH_NISTP256_SHA256 "ecdh-nistp256-ntruprime-sntrup653-sha256" +#define KEX_NTRUPRIME_NTRULPR761_ECDH_NISTP384_SHA384 "ecdh-nistp384-ntruprime-ntrulpr761-sha384" +#define KEX_NTRUPRIME_SNTRUP761_ECDH_NISTP384_SHA384 "ecdh-nistp384-ntruprime-sntrup761-sha384" +#define KEX_NTRUPRIME_NTRULPR857_ECDH_NISTP384_SHA384 "ecdh-nistp384-ntruprime-ntrulpr857-sha384" +#define KEX_NTRUPRIME_SNTRUP857_ECDH_NISTP384_SHA384 "ecdh-nistp384-ntruprime-sntrup857-sha384" #endif /* OPENSSL_HAS_ECC */ #endif /* WITH_OPENSSL */ ///// OQS_TEMPLATE_FRAGMENT_DEFINE_KEX_PRETTY_NAMES_END @@ -124,14 +224,114 @@ enum kex_exchange { KEX_KEM_FRODOKEM_640_AES_SHA256, KEX_KEM_FRODOKEM_976_AES_SHA384, KEX_KEM_FRODOKEM_1344_AES_SHA512, + KEX_KEM_FRODOKEM_640_SHAKE_SHA256, + KEX_KEM_FRODOKEM_976_SHAKE_SHA384, + KEX_KEM_FRODOKEM_1344_SHAKE_SHA512, + KEX_KEM_SIDH_P434_SHA256, + KEX_KEM_SIDH_P434_COMPRESSED_SHA256, + KEX_KEM_SIDH_P610_SHA256, + KEX_KEM_SIDH_P610_COMPRESSED_SHA256, + KEX_KEM_SIDH_P751_SHA256, + KEX_KEM_SIDH_P751_COMPRESSED_SHA256, KEX_KEM_SIKE_P434_SHA256, + KEX_KEM_SIKE_P434_COMPRESSED_SHA256, + KEX_KEM_SIKE_P610_SHA256, + KEX_KEM_SIKE_P610_COMPRESSED_SHA256, + KEX_KEM_SIKE_P751_SHA256, + KEX_KEM_SIKE_P751_COMPRESSED_SHA256, + KEX_KEM_SABER_LIGHTSABER_SHA256, + KEX_KEM_SABER_SABER_SHA384, + KEX_KEM_SABER_FIRESABER_SHA512, + KEX_KEM_KYBER_512_SHA256, + KEX_KEM_KYBER_768_SHA384, + KEX_KEM_KYBER_1024_SHA512, + KEX_KEM_KYBER_512_90S_SHA256, + KEX_KEM_KYBER_768_90S_SHA384, + KEX_KEM_KYBER_1024_90S_SHA512, + KEX_KEM_BIKE1_L1_CPA_SHA512, + KEX_KEM_BIKE1_L1_FO_SHA512, + KEX_KEM_BIKE1_L3_CPA_SHA512, + KEX_KEM_BIKE1_L3_FO_SHA512, + KEX_KEM_NTRU_HPS2048509_SHA512, + KEX_KEM_NTRU_HPS2048677_SHA512, + KEX_KEM_NTRU_HRSS701_SHA512, + KEX_KEM_NTRU_HPS4096821_SHA512, + KEX_KEM_CLASSIC_MCELIECE_348864_SHA256, + KEX_KEM_CLASSIC_MCELIECE_348864F_SHA256, + KEX_KEM_CLASSIC_MCELIECE_460896_SHA512, + KEX_KEM_CLASSIC_MCELIECE_460896F_SHA512, + KEX_KEM_CLASSIC_MCELIECE_6688128_SHA512, + KEX_KEM_CLASSIC_MCELIECE_6688128F_SHA512, + KEX_KEM_CLASSIC_MCELIECE_6960119_SHA512, + 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_192_SHA384, + KEX_KEM_HQC_256_SHA512, + KEX_KEM_NTRUPRIME_NTRULPR653_SHA256, + KEX_KEM_NTRUPRIME_SNTRUP653_SHA256, + KEX_KEM_NTRUPRIME_NTRULPR761_SHA384, + KEX_KEM_NTRUPRIME_SNTRUP761_SHA384, + KEX_KEM_NTRUPRIME_NTRULPR857_SHA384, + KEX_KEM_NTRUPRIME_SNTRUP857_SHA384, #ifdef WITH_OPENSSL #ifdef OPENSSL_HAS_ECC KEX_KEM_OQS_DEFAULT_ECDH_NISTP256_SHA256, KEX_KEM_FRODOKEM_640_AES_ECDH_NISTP256_SHA256, KEX_KEM_FRODOKEM_976_AES_ECDH_NISTP384_SHA384, KEX_KEM_FRODOKEM_1344_AES_ECDH_NISTP521_SHA512, + KEX_KEM_FRODOKEM_640_SHAKE_ECDH_NISTP256_SHA256, + KEX_KEM_FRODOKEM_976_SHAKE_ECDH_NISTP384_SHA384, + KEX_KEM_FRODOKEM_1344_SHAKE_ECDH_NISTP521_SHA512, + KEX_KEM_SIDH_P434_ECDH_NISTP256_SHA256, + KEX_KEM_SIDH_P434_COMPRESSED_ECDH_NISTP256_SHA256, + KEX_KEM_SIDH_P610_ECDH_NISTP384_SHA256, + KEX_KEM_SIDH_P610_COMPRESSED_ECDH_NISTP384_SHA256, + KEX_KEM_SIDH_P751_ECDH_NISTP521_SHA256, + KEX_KEM_SIDH_P751_COMPRESSED_ECDH_NISTP521_SHA256, KEX_KEM_SIKE_P434_ECDH_NISTP256_SHA256, + KEX_KEM_SIKE_P434_COMPRESSED_ECDH_NISTP256_SHA256, + KEX_KEM_SIKE_P610_ECDH_NISTP384_SHA256, + KEX_KEM_SIKE_P610_COMPRESSED_ECDH_NISTP384_SHA256, + KEX_KEM_SIKE_P751_ECDH_NISTP521_SHA256, + KEX_KEM_SIKE_P751_COMPRESSED_ECDH_NISTP521_SHA256, + KEX_KEM_SABER_LIGHTSABER_ECDH_NISTP256_SHA256, + KEX_KEM_SABER_SABER_ECDH_NISTP384_SHA384, + KEX_KEM_SABER_FIRESABER_ECDH_NISTP521_SHA512, + KEX_KEM_KYBER_512_ECDH_NISTP256_SHA256, + KEX_KEM_KYBER_768_ECDH_NISTP384_SHA384, + KEX_KEM_KYBER_1024_ECDH_NISTP521_SHA512, + KEX_KEM_KYBER_512_90S_ECDH_NISTP256_SHA256, + KEX_KEM_KYBER_768_90S_ECDH_NISTP384_SHA384, + KEX_KEM_KYBER_1024_90S_ECDH_NISTP521_SHA512, + KEX_KEM_BIKE1_L1_CPA_ECDH_NISTP256_SHA512, + KEX_KEM_BIKE1_L1_FO_ECDH_NISTP256_SHA512, + KEX_KEM_BIKE1_L3_CPA_ECDH_NISTP384_SHA512, + KEX_KEM_BIKE1_L3_FO_ECDH_NISTP384_SHA512, + KEX_KEM_NTRU_HPS2048509_ECDH_NISTP256_SHA512, + KEX_KEM_NTRU_HPS2048677_ECDH_NISTP384_SHA512, + KEX_KEM_NTRU_HRSS701_ECDH_NISTP384_SHA512, + KEX_KEM_NTRU_HPS4096821_ECDH_NISTP521_SHA512, + KEX_KEM_CLASSIC_MCELIECE_348864_ECDH_NISTP256_SHA256, + KEX_KEM_CLASSIC_MCELIECE_348864F_ECDH_NISTP256_SHA256, + KEX_KEM_CLASSIC_MCELIECE_460896_ECDH_NISTP384_SHA512, + KEX_KEM_CLASSIC_MCELIECE_460896F_ECDH_NISTP384_SHA512, + KEX_KEM_CLASSIC_MCELIECE_6688128_ECDH_NISTP521_SHA512, + KEX_KEM_CLASSIC_MCELIECE_6688128F_ECDH_NISTP521_SHA512, + KEX_KEM_CLASSIC_MCELIECE_6960119_ECDH_NISTP521_SHA512, + 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_NTRUPRIME_NTRULPR653_ECDH_NISTP256_SHA256, + KEX_KEM_NTRUPRIME_SNTRUP653_ECDH_NISTP256_SHA256, + KEX_KEM_NTRUPRIME_NTRULPR761_ECDH_NISTP384_SHA384, + KEX_KEM_NTRUPRIME_SNTRUP761_ECDH_NISTP384_SHA384, + KEX_KEM_NTRUPRIME_NTRULPR857_ECDH_NISTP384_SHA384, + KEX_KEM_NTRUPRIME_SNTRUP857_ECDH_NISTP384_SHA384, #endif /* OPENSSL_HAS_ECC */ #endif /* WITH_OPENSSL */ ///// OQS_TEMPLATE_FRAGMENT_ADD_KEX_ENUMS_END @@ -276,10 +476,210 @@ int kex_kem_frodokem_976_aes_dec(struct kex *, const struct sshbuf *, struct ss int kex_kem_frodokem_1344_aes_keypair(struct kex *); int kex_kem_frodokem_1344_aes_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); int kex_kem_frodokem_1344_aes_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* frodokem_640_shake prototypes */ +int kex_kem_frodokem_640_shake_keypair(struct kex *); +int kex_kem_frodokem_640_shake_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_frodokem_640_shake_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* frodokem_976_shake prototypes */ +int kex_kem_frodokem_976_shake_keypair(struct kex *); +int kex_kem_frodokem_976_shake_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_frodokem_976_shake_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* frodokem_1344_shake prototypes */ +int kex_kem_frodokem_1344_shake_keypair(struct kex *); +int kex_kem_frodokem_1344_shake_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_frodokem_1344_shake_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* sidh_p434 prototypes */ +int kex_kem_sidh_p434_keypair(struct kex *); +int kex_kem_sidh_p434_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_sidh_p434_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* sidh_p434_compressed prototypes */ +int kex_kem_sidh_p434_compressed_keypair(struct kex *); +int kex_kem_sidh_p434_compressed_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_sidh_p434_compressed_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* sidh_p610 prototypes */ +int kex_kem_sidh_p610_keypair(struct kex *); +int kex_kem_sidh_p610_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_sidh_p610_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* sidh_p610_compressed prototypes */ +int kex_kem_sidh_p610_compressed_keypair(struct kex *); +int kex_kem_sidh_p610_compressed_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_sidh_p610_compressed_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* sidh_p751 prototypes */ +int kex_kem_sidh_p751_keypair(struct kex *); +int kex_kem_sidh_p751_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_sidh_p751_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* sidh_p751_compressed prototypes */ +int kex_kem_sidh_p751_compressed_keypair(struct kex *); +int kex_kem_sidh_p751_compressed_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_sidh_p751_compressed_dec(struct kex *, const struct sshbuf *, struct sshbuf **); /* sike_p434 prototypes */ int kex_kem_sike_p434_keypair(struct kex *); int kex_kem_sike_p434_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); int kex_kem_sike_p434_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* sike_p434_compressed prototypes */ +int kex_kem_sike_p434_compressed_keypair(struct kex *); +int kex_kem_sike_p434_compressed_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_sike_p434_compressed_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* sike_p610 prototypes */ +int kex_kem_sike_p610_keypair(struct kex *); +int kex_kem_sike_p610_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_sike_p610_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* sike_p610_compressed prototypes */ +int kex_kem_sike_p610_compressed_keypair(struct kex *); +int kex_kem_sike_p610_compressed_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_sike_p610_compressed_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* sike_p751 prototypes */ +int kex_kem_sike_p751_keypair(struct kex *); +int kex_kem_sike_p751_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_sike_p751_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* sike_p751_compressed prototypes */ +int kex_kem_sike_p751_compressed_keypair(struct kex *); +int kex_kem_sike_p751_compressed_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_sike_p751_compressed_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* saber_lightsaber prototypes */ +int kex_kem_saber_lightsaber_keypair(struct kex *); +int kex_kem_saber_lightsaber_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_saber_lightsaber_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* saber_saber prototypes */ +int kex_kem_saber_saber_keypair(struct kex *); +int kex_kem_saber_saber_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_saber_saber_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* saber_firesaber prototypes */ +int kex_kem_saber_firesaber_keypair(struct kex *); +int kex_kem_saber_firesaber_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_saber_firesaber_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* kyber_512 prototypes */ +int kex_kem_kyber_512_keypair(struct kex *); +int kex_kem_kyber_512_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_kyber_512_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* kyber_768 prototypes */ +int kex_kem_kyber_768_keypair(struct kex *); +int kex_kem_kyber_768_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_kyber_768_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* kyber_1024 prototypes */ +int kex_kem_kyber_1024_keypair(struct kex *); +int kex_kem_kyber_1024_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_kyber_1024_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* kyber_512_90s prototypes */ +int kex_kem_kyber_512_90s_keypair(struct kex *); +int kex_kem_kyber_512_90s_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_kyber_512_90s_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* kyber_768_90s prototypes */ +int kex_kem_kyber_768_90s_keypair(struct kex *); +int kex_kem_kyber_768_90s_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_kyber_768_90s_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* kyber_1024_90s prototypes */ +int kex_kem_kyber_1024_90s_keypair(struct kex *); +int kex_kem_kyber_1024_90s_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_kyber_1024_90s_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* bike1_l1_cpa prototypes */ +int kex_kem_bike1_l1_cpa_keypair(struct kex *); +int kex_kem_bike1_l1_cpa_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_bike1_l1_cpa_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* bike1_l1_fo prototypes */ +int kex_kem_bike1_l1_fo_keypair(struct kex *); +int kex_kem_bike1_l1_fo_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_bike1_l1_fo_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* bike1_l3_cpa prototypes */ +int kex_kem_bike1_l3_cpa_keypair(struct kex *); +int kex_kem_bike1_l3_cpa_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_bike1_l3_cpa_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* bike1_l3_fo prototypes */ +int kex_kem_bike1_l3_fo_keypair(struct kex *); +int kex_kem_bike1_l3_fo_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_bike1_l3_fo_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* ntru_hps2048509 prototypes */ +int kex_kem_ntru_hps2048509_keypair(struct kex *); +int kex_kem_ntru_hps2048509_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_ntru_hps2048509_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* ntru_hps2048677 prototypes */ +int kex_kem_ntru_hps2048677_keypair(struct kex *); +int kex_kem_ntru_hps2048677_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_ntru_hps2048677_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* ntru_hrss701 prototypes */ +int kex_kem_ntru_hrss701_keypair(struct kex *); +int kex_kem_ntru_hrss701_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_ntru_hrss701_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* ntru_hps4096821 prototypes */ +int kex_kem_ntru_hps4096821_keypair(struct kex *); +int kex_kem_ntru_hps4096821_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_ntru_hps4096821_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* classic_mceliece_348864 prototypes */ +int kex_kem_classic_mceliece_348864_keypair(struct kex *); +int kex_kem_classic_mceliece_348864_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_classic_mceliece_348864_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* classic_mceliece_348864f prototypes */ +int kex_kem_classic_mceliece_348864f_keypair(struct kex *); +int kex_kem_classic_mceliece_348864f_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_classic_mceliece_348864f_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* classic_mceliece_460896 prototypes */ +int kex_kem_classic_mceliece_460896_keypair(struct kex *); +int kex_kem_classic_mceliece_460896_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_classic_mceliece_460896_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* classic_mceliece_460896f prototypes */ +int kex_kem_classic_mceliece_460896f_keypair(struct kex *); +int kex_kem_classic_mceliece_460896f_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_classic_mceliece_460896f_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* classic_mceliece_6688128 prototypes */ +int kex_kem_classic_mceliece_6688128_keypair(struct kex *); +int kex_kem_classic_mceliece_6688128_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_classic_mceliece_6688128_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* classic_mceliece_6688128f prototypes */ +int kex_kem_classic_mceliece_6688128f_keypair(struct kex *); +int kex_kem_classic_mceliece_6688128f_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_classic_mceliece_6688128f_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* classic_mceliece_6960119 prototypes */ +int kex_kem_classic_mceliece_6960119_keypair(struct kex *); +int kex_kem_classic_mceliece_6960119_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_classic_mceliece_6960119_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* classic_mceliece_6960119f prototypes */ +int kex_kem_classic_mceliece_6960119f_keypair(struct kex *); +int kex_kem_classic_mceliece_6960119f_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_classic_mceliece_6960119f_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* classic_mceliece_8192128 prototypes */ +int kex_kem_classic_mceliece_8192128_keypair(struct kex *); +int kex_kem_classic_mceliece_8192128_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_classic_mceliece_8192128_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* classic_mceliece_8192128f prototypes */ +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_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 **); +/* ntruprime_ntrulpr653 prototypes */ +int kex_kem_ntruprime_ntrulpr653_keypair(struct kex *); +int kex_kem_ntruprime_ntrulpr653_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_ntruprime_ntrulpr653_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* ntruprime_sntrup653 prototypes */ +int kex_kem_ntruprime_sntrup653_keypair(struct kex *); +int kex_kem_ntruprime_sntrup653_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_ntruprime_sntrup653_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* ntruprime_ntrulpr761 prototypes */ +int kex_kem_ntruprime_ntrulpr761_keypair(struct kex *); +int kex_kem_ntruprime_ntrulpr761_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_ntruprime_ntrulpr761_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* ntruprime_sntrup761 prototypes */ +int kex_kem_ntruprime_sntrup761_keypair(struct kex *); +int kex_kem_ntruprime_sntrup761_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_ntruprime_sntrup761_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* ntruprime_ntrulpr857 prototypes */ +int kex_kem_ntruprime_ntrulpr857_keypair(struct kex *); +int kex_kem_ntruprime_ntrulpr857_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_ntruprime_ntrulpr857_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* ntruprime_sntrup857 prototypes */ +int kex_kem_ntruprime_sntrup857_keypair(struct kex *); +int kex_kem_ntruprime_sntrup857_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_ntruprime_sntrup857_dec(struct kex *, const struct sshbuf *, struct sshbuf **); #ifdef WITH_OPENSSL #ifdef OPENSSL_HAS_ECC /* oqs_default_nistp256 prototypes */ @@ -298,10 +698,210 @@ int kex_kem_frodokem_976_aes_ecdh_nistp384_dec(struct kex *, const struct sshbu int kex_kem_frodokem_1344_aes_ecdh_nistp521_keypair(struct kex *); int kex_kem_frodokem_1344_aes_ecdh_nistp521_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); int kex_kem_frodokem_1344_aes_ecdh_nistp521_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* frodokem_640_shake_nistp256 prototypes */ +int kex_kem_frodokem_640_shake_ecdh_nistp256_keypair(struct kex *); +int kex_kem_frodokem_640_shake_ecdh_nistp256_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_frodokem_640_shake_ecdh_nistp256_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* frodokem_976_shake_nistp384 prototypes */ +int kex_kem_frodokem_976_shake_ecdh_nistp384_keypair(struct kex *); +int kex_kem_frodokem_976_shake_ecdh_nistp384_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_frodokem_976_shake_ecdh_nistp384_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* frodokem_1344_shake_nistp521 prototypes */ +int kex_kem_frodokem_1344_shake_ecdh_nistp521_keypair(struct kex *); +int kex_kem_frodokem_1344_shake_ecdh_nistp521_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_frodokem_1344_shake_ecdh_nistp521_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* sidh_p434_nistp256 prototypes */ +int kex_kem_sidh_p434_ecdh_nistp256_keypair(struct kex *); +int kex_kem_sidh_p434_ecdh_nistp256_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_sidh_p434_ecdh_nistp256_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* sidh_p434_compressed_nistp256 prototypes */ +int kex_kem_sidh_p434_compressed_ecdh_nistp256_keypair(struct kex *); +int kex_kem_sidh_p434_compressed_ecdh_nistp256_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_sidh_p434_compressed_ecdh_nistp256_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* sidh_p610_nistp384 prototypes */ +int kex_kem_sidh_p610_ecdh_nistp384_keypair(struct kex *); +int kex_kem_sidh_p610_ecdh_nistp384_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_sidh_p610_ecdh_nistp384_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* sidh_p610_compressed_nistp384 prototypes */ +int kex_kem_sidh_p610_compressed_ecdh_nistp384_keypair(struct kex *); +int kex_kem_sidh_p610_compressed_ecdh_nistp384_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_sidh_p610_compressed_ecdh_nistp384_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* sidh_p751_nistp521 prototypes */ +int kex_kem_sidh_p751_ecdh_nistp521_keypair(struct kex *); +int kex_kem_sidh_p751_ecdh_nistp521_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_sidh_p751_ecdh_nistp521_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* sidh_p751_compressed_nistp521 prototypes */ +int kex_kem_sidh_p751_compressed_ecdh_nistp521_keypair(struct kex *); +int kex_kem_sidh_p751_compressed_ecdh_nistp521_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_sidh_p751_compressed_ecdh_nistp521_dec(struct kex *, const struct sshbuf *, struct sshbuf **); /* sike_p434_nistp256 prototypes */ int kex_kem_sike_p434_ecdh_nistp256_keypair(struct kex *); int kex_kem_sike_p434_ecdh_nistp256_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); int kex_kem_sike_p434_ecdh_nistp256_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* sike_p434_compressed_nistp256 prototypes */ +int kex_kem_sike_p434_compressed_ecdh_nistp256_keypair(struct kex *); +int kex_kem_sike_p434_compressed_ecdh_nistp256_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_sike_p434_compressed_ecdh_nistp256_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* sike_p610_nistp384 prototypes */ +int kex_kem_sike_p610_ecdh_nistp384_keypair(struct kex *); +int kex_kem_sike_p610_ecdh_nistp384_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_sike_p610_ecdh_nistp384_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* sike_p610_compressed_nistp384 prototypes */ +int kex_kem_sike_p610_compressed_ecdh_nistp384_keypair(struct kex *); +int kex_kem_sike_p610_compressed_ecdh_nistp384_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_sike_p610_compressed_ecdh_nistp384_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* sike_p751_nistp521 prototypes */ +int kex_kem_sike_p751_ecdh_nistp521_keypair(struct kex *); +int kex_kem_sike_p751_ecdh_nistp521_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_sike_p751_ecdh_nistp521_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* sike_p751_compressed_nistp521 prototypes */ +int kex_kem_sike_p751_compressed_ecdh_nistp521_keypair(struct kex *); +int kex_kem_sike_p751_compressed_ecdh_nistp521_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_sike_p751_compressed_ecdh_nistp521_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* saber_lightsaber_nistp256 prototypes */ +int kex_kem_saber_lightsaber_ecdh_nistp256_keypair(struct kex *); +int kex_kem_saber_lightsaber_ecdh_nistp256_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_saber_lightsaber_ecdh_nistp256_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* saber_saber_nistp384 prototypes */ +int kex_kem_saber_saber_ecdh_nistp384_keypair(struct kex *); +int kex_kem_saber_saber_ecdh_nistp384_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_saber_saber_ecdh_nistp384_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* saber_firesaber_nistp521 prototypes */ +int kex_kem_saber_firesaber_ecdh_nistp521_keypair(struct kex *); +int kex_kem_saber_firesaber_ecdh_nistp521_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_saber_firesaber_ecdh_nistp521_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* kyber_512_nistp256 prototypes */ +int kex_kem_kyber_512_ecdh_nistp256_keypair(struct kex *); +int kex_kem_kyber_512_ecdh_nistp256_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_kyber_512_ecdh_nistp256_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* kyber_768_nistp384 prototypes */ +int kex_kem_kyber_768_ecdh_nistp384_keypair(struct kex *); +int kex_kem_kyber_768_ecdh_nistp384_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_kyber_768_ecdh_nistp384_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* kyber_1024_nistp521 prototypes */ +int kex_kem_kyber_1024_ecdh_nistp521_keypair(struct kex *); +int kex_kem_kyber_1024_ecdh_nistp521_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_kyber_1024_ecdh_nistp521_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* kyber_512_90s_nistp256 prototypes */ +int kex_kem_kyber_512_90s_ecdh_nistp256_keypair(struct kex *); +int kex_kem_kyber_512_90s_ecdh_nistp256_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_kyber_512_90s_ecdh_nistp256_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* kyber_768_90s_nistp384 prototypes */ +int kex_kem_kyber_768_90s_ecdh_nistp384_keypair(struct kex *); +int kex_kem_kyber_768_90s_ecdh_nistp384_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_kyber_768_90s_ecdh_nistp384_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* kyber_1024_90s_nistp521 prototypes */ +int kex_kem_kyber_1024_90s_ecdh_nistp521_keypair(struct kex *); +int kex_kem_kyber_1024_90s_ecdh_nistp521_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_kyber_1024_90s_ecdh_nistp521_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* bike1_l1_cpa_nistp256 prototypes */ +int kex_kem_bike1_l1_cpa_ecdh_nistp256_keypair(struct kex *); +int kex_kem_bike1_l1_cpa_ecdh_nistp256_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_bike1_l1_cpa_ecdh_nistp256_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* bike1_l1_fo_nistp256 prototypes */ +int kex_kem_bike1_l1_fo_ecdh_nistp256_keypair(struct kex *); +int kex_kem_bike1_l1_fo_ecdh_nistp256_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_bike1_l1_fo_ecdh_nistp256_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* bike1_l3_cpa_nistp384 prototypes */ +int kex_kem_bike1_l3_cpa_ecdh_nistp384_keypair(struct kex *); +int kex_kem_bike1_l3_cpa_ecdh_nistp384_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_bike1_l3_cpa_ecdh_nistp384_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* bike1_l3_fo_nistp384 prototypes */ +int kex_kem_bike1_l3_fo_ecdh_nistp384_keypair(struct kex *); +int kex_kem_bike1_l3_fo_ecdh_nistp384_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_bike1_l3_fo_ecdh_nistp384_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* ntru_hps2048509_nistp256 prototypes */ +int kex_kem_ntru_hps2048509_ecdh_nistp256_keypair(struct kex *); +int kex_kem_ntru_hps2048509_ecdh_nistp256_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_ntru_hps2048509_ecdh_nistp256_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* ntru_hps2048677_nistp384 prototypes */ +int kex_kem_ntru_hps2048677_ecdh_nistp384_keypair(struct kex *); +int kex_kem_ntru_hps2048677_ecdh_nistp384_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_ntru_hps2048677_ecdh_nistp384_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* ntru_hrss701_nistp384 prototypes */ +int kex_kem_ntru_hrss701_ecdh_nistp384_keypair(struct kex *); +int kex_kem_ntru_hrss701_ecdh_nistp384_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_ntru_hrss701_ecdh_nistp384_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* ntru_hps4096821_nistp521 prototypes */ +int kex_kem_ntru_hps4096821_ecdh_nistp521_keypair(struct kex *); +int kex_kem_ntru_hps4096821_ecdh_nistp521_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_ntru_hps4096821_ecdh_nistp521_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* classic_mceliece_348864_nistp256 prototypes */ +int kex_kem_classic_mceliece_348864_ecdh_nistp256_keypair(struct kex *); +int kex_kem_classic_mceliece_348864_ecdh_nistp256_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_classic_mceliece_348864_ecdh_nistp256_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* classic_mceliece_348864f_nistp256 prototypes */ +int kex_kem_classic_mceliece_348864f_ecdh_nistp256_keypair(struct kex *); +int kex_kem_classic_mceliece_348864f_ecdh_nistp256_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_classic_mceliece_348864f_ecdh_nistp256_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* classic_mceliece_460896_nistp384 prototypes */ +int kex_kem_classic_mceliece_460896_ecdh_nistp384_keypair(struct kex *); +int kex_kem_classic_mceliece_460896_ecdh_nistp384_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_classic_mceliece_460896_ecdh_nistp384_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* classic_mceliece_460896f_nistp384 prototypes */ +int kex_kem_classic_mceliece_460896f_ecdh_nistp384_keypair(struct kex *); +int kex_kem_classic_mceliece_460896f_ecdh_nistp384_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_classic_mceliece_460896f_ecdh_nistp384_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* classic_mceliece_6688128_nistp521 prototypes */ +int kex_kem_classic_mceliece_6688128_ecdh_nistp521_keypair(struct kex *); +int kex_kem_classic_mceliece_6688128_ecdh_nistp521_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_classic_mceliece_6688128_ecdh_nistp521_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* classic_mceliece_6688128f_nistp521 prototypes */ +int kex_kem_classic_mceliece_6688128f_ecdh_nistp521_keypair(struct kex *); +int kex_kem_classic_mceliece_6688128f_ecdh_nistp521_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_classic_mceliece_6688128f_ecdh_nistp521_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* classic_mceliece_6960119_nistp521 prototypes */ +int kex_kem_classic_mceliece_6960119_ecdh_nistp521_keypair(struct kex *); +int kex_kem_classic_mceliece_6960119_ecdh_nistp521_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_classic_mceliece_6960119_ecdh_nistp521_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* classic_mceliece_6960119f_nistp521 prototypes */ +int kex_kem_classic_mceliece_6960119f_ecdh_nistp521_keypair(struct kex *); +int kex_kem_classic_mceliece_6960119f_ecdh_nistp521_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_classic_mceliece_6960119f_ecdh_nistp521_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* classic_mceliece_8192128_nistp521 prototypes */ +int kex_kem_classic_mceliece_8192128_ecdh_nistp521_keypair(struct kex *); +int kex_kem_classic_mceliece_8192128_ecdh_nistp521_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_classic_mceliece_8192128_ecdh_nistp521_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* classic_mceliece_8192128f_nistp521 prototypes */ +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 **); +/* ntruprime_ntrulpr653_nistp256 prototypes */ +int kex_kem_ntruprime_ntrulpr653_ecdh_nistp256_keypair(struct kex *); +int kex_kem_ntruprime_ntrulpr653_ecdh_nistp256_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_ntruprime_ntrulpr653_ecdh_nistp256_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* ntruprime_sntrup653_nistp256 prototypes */ +int kex_kem_ntruprime_sntrup653_ecdh_nistp256_keypair(struct kex *); +int kex_kem_ntruprime_sntrup653_ecdh_nistp256_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_ntruprime_sntrup653_ecdh_nistp256_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* ntruprime_ntrulpr761_nistp384 prototypes */ +int kex_kem_ntruprime_ntrulpr761_ecdh_nistp384_keypair(struct kex *); +int kex_kem_ntruprime_ntrulpr761_ecdh_nistp384_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_ntruprime_ntrulpr761_ecdh_nistp384_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* ntruprime_sntrup761_nistp384 prototypes */ +int kex_kem_ntruprime_sntrup761_ecdh_nistp384_keypair(struct kex *); +int kex_kem_ntruprime_sntrup761_ecdh_nistp384_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_ntruprime_sntrup761_ecdh_nistp384_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* ntruprime_ntrulpr857_nistp384 prototypes */ +int kex_kem_ntruprime_ntrulpr857_ecdh_nistp384_keypair(struct kex *); +int kex_kem_ntruprime_ntrulpr857_ecdh_nistp384_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_ntruprime_ntrulpr857_ecdh_nistp384_dec(struct kex *, const struct sshbuf *, struct sshbuf **); +/* ntruprime_sntrup857_nistp384 prototypes */ +int kex_kem_ntruprime_sntrup857_ecdh_nistp384_keypair(struct kex *); +int kex_kem_ntruprime_sntrup857_ecdh_nistp384_enc(struct kex *, const struct sshbuf *, struct sshbuf **, struct sshbuf **); +int kex_kem_ntruprime_sntrup857_ecdh_nistp384_dec(struct kex *, const struct sshbuf *, struct sshbuf **); #endif /* OPENSSL_HAS_ECC */ #endif /* WITH_OPENSSL */ ///// OQS_TEMPLATE_FRAGMENT_DECLARE_KEX_PROTOTYPES_END diff --git a/kexgen.c b/kexgen.c index d45f288f13c8..00d229997919 100644 --- a/kexgen.c +++ b/kexgen.c @@ -134,9 +134,159 @@ kex_gen_client(struct ssh *ssh) case KEX_KEM_FRODOKEM_1344_AES_SHA512: r = kex_kem_frodokem_1344_aes_keypair(kex); break; + case KEX_KEM_FRODOKEM_640_SHAKE_SHA256: + r = kex_kem_frodokem_640_shake_keypair(kex); + break; + case KEX_KEM_FRODOKEM_976_SHAKE_SHA384: + r = kex_kem_frodokem_976_shake_keypair(kex); + break; + case KEX_KEM_FRODOKEM_1344_SHAKE_SHA512: + r = kex_kem_frodokem_1344_shake_keypair(kex); + break; + case KEX_KEM_SIDH_P434_SHA256: + r = kex_kem_sidh_p434_keypair(kex); + break; + case KEX_KEM_SIDH_P434_COMPRESSED_SHA256: + r = kex_kem_sidh_p434_compressed_keypair(kex); + break; + case KEX_KEM_SIDH_P610_SHA256: + r = kex_kem_sidh_p610_keypair(kex); + break; + case KEX_KEM_SIDH_P610_COMPRESSED_SHA256: + r = kex_kem_sidh_p610_compressed_keypair(kex); + break; + case KEX_KEM_SIDH_P751_SHA256: + r = kex_kem_sidh_p751_keypair(kex); + break; + case KEX_KEM_SIDH_P751_COMPRESSED_SHA256: + r = kex_kem_sidh_p751_compressed_keypair(kex); + break; case KEX_KEM_SIKE_P434_SHA256: r = kex_kem_sike_p434_keypair(kex); break; + case KEX_KEM_SIKE_P434_COMPRESSED_SHA256: + r = kex_kem_sike_p434_compressed_keypair(kex); + break; + case KEX_KEM_SIKE_P610_SHA256: + r = kex_kem_sike_p610_keypair(kex); + break; + case KEX_KEM_SIKE_P610_COMPRESSED_SHA256: + r = kex_kem_sike_p610_compressed_keypair(kex); + break; + case KEX_KEM_SIKE_P751_SHA256: + r = kex_kem_sike_p751_keypair(kex); + break; + case KEX_KEM_SIKE_P751_COMPRESSED_SHA256: + r = kex_kem_sike_p751_compressed_keypair(kex); + break; + case KEX_KEM_SABER_LIGHTSABER_SHA256: + r = kex_kem_saber_lightsaber_keypair(kex); + break; + case KEX_KEM_SABER_SABER_SHA384: + r = kex_kem_saber_saber_keypair(kex); + break; + case KEX_KEM_SABER_FIRESABER_SHA512: + r = kex_kem_saber_firesaber_keypair(kex); + break; + case KEX_KEM_KYBER_512_SHA256: + r = kex_kem_kyber_512_keypair(kex); + break; + case KEX_KEM_KYBER_768_SHA384: + r = kex_kem_kyber_768_keypair(kex); + break; + case KEX_KEM_KYBER_1024_SHA512: + r = kex_kem_kyber_1024_keypair(kex); + break; + case KEX_KEM_KYBER_512_90S_SHA256: + r = kex_kem_kyber_512_90s_keypair(kex); + break; + case KEX_KEM_KYBER_768_90S_SHA384: + r = kex_kem_kyber_768_90s_keypair(kex); + break; + case KEX_KEM_KYBER_1024_90S_SHA512: + r = kex_kem_kyber_1024_90s_keypair(kex); + break; + case KEX_KEM_BIKE1_L1_CPA_SHA512: + r = kex_kem_bike1_l1_cpa_keypair(kex); + break; + case KEX_KEM_BIKE1_L1_FO_SHA512: + r = kex_kem_bike1_l1_fo_keypair(kex); + break; + case KEX_KEM_BIKE1_L3_CPA_SHA512: + r = kex_kem_bike1_l3_cpa_keypair(kex); + break; + case KEX_KEM_BIKE1_L3_FO_SHA512: + r = kex_kem_bike1_l3_fo_keypair(kex); + break; + case KEX_KEM_NTRU_HPS2048509_SHA512: + r = kex_kem_ntru_hps2048509_keypair(kex); + break; + case KEX_KEM_NTRU_HPS2048677_SHA512: + r = kex_kem_ntru_hps2048677_keypair(kex); + break; + case KEX_KEM_NTRU_HRSS701_SHA512: + r = kex_kem_ntru_hrss701_keypair(kex); + break; + case KEX_KEM_NTRU_HPS4096821_SHA512: + r = kex_kem_ntru_hps4096821_keypair(kex); + break; + case KEX_KEM_CLASSIC_MCELIECE_348864_SHA256: + r = kex_kem_classic_mceliece_348864_keypair(kex); + break; + case KEX_KEM_CLASSIC_MCELIECE_348864F_SHA256: + r = kex_kem_classic_mceliece_348864f_keypair(kex); + break; + case KEX_KEM_CLASSIC_MCELIECE_460896_SHA512: + r = kex_kem_classic_mceliece_460896_keypair(kex); + break; + case KEX_KEM_CLASSIC_MCELIECE_460896F_SHA512: + r = kex_kem_classic_mceliece_460896f_keypair(kex); + break; + case KEX_KEM_CLASSIC_MCELIECE_6688128_SHA512: + r = kex_kem_classic_mceliece_6688128_keypair(kex); + break; + case KEX_KEM_CLASSIC_MCELIECE_6688128F_SHA512: + r = kex_kem_classic_mceliece_6688128f_keypair(kex); + break; + case KEX_KEM_CLASSIC_MCELIECE_6960119_SHA512: + r = kex_kem_classic_mceliece_6960119_keypair(kex); + break; + case KEX_KEM_CLASSIC_MCELIECE_6960119F_SHA512: + r = kex_kem_classic_mceliece_6960119f_keypair(kex); + break; + case KEX_KEM_CLASSIC_MCELIECE_8192128_SHA512: + r = kex_kem_classic_mceliece_8192128_keypair(kex); + break; + 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_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_NTRUPRIME_NTRULPR653_SHA256: + r = kex_kem_ntruprime_ntrulpr653_keypair(kex); + break; + case KEX_KEM_NTRUPRIME_SNTRUP653_SHA256: + r = kex_kem_ntruprime_sntrup653_keypair(kex); + break; + case KEX_KEM_NTRUPRIME_NTRULPR761_SHA384: + r = kex_kem_ntruprime_ntrulpr761_keypair(kex); + break; + case KEX_KEM_NTRUPRIME_SNTRUP761_SHA384: + r = kex_kem_ntruprime_sntrup761_keypair(kex); + break; + case KEX_KEM_NTRUPRIME_NTRULPR857_SHA384: + r = kex_kem_ntruprime_ntrulpr857_keypair(kex); + break; + case KEX_KEM_NTRUPRIME_SNTRUP857_SHA384: + r = kex_kem_ntruprime_sntrup857_keypair(kex); + break; #ifdef WITH_OPENSSL #ifdef OPENSSL_HAS_ECC case KEX_KEM_OQS_DEFAULT_ECDH_NISTP256_SHA256: @@ -151,9 +301,159 @@ kex_gen_client(struct ssh *ssh) case KEX_KEM_FRODOKEM_1344_AES_ECDH_NISTP521_SHA512: r = kex_kem_frodokem_1344_aes_ecdh_nistp521_keypair(kex); break; + case KEX_KEM_FRODOKEM_640_SHAKE_ECDH_NISTP256_SHA256: + r = kex_kem_frodokem_640_shake_ecdh_nistp256_keypair(kex); + break; + case KEX_KEM_FRODOKEM_976_SHAKE_ECDH_NISTP384_SHA384: + r = kex_kem_frodokem_976_shake_ecdh_nistp384_keypair(kex); + break; + case KEX_KEM_FRODOKEM_1344_SHAKE_ECDH_NISTP521_SHA512: + r = kex_kem_frodokem_1344_shake_ecdh_nistp521_keypair(kex); + break; + case KEX_KEM_SIDH_P434_ECDH_NISTP256_SHA256: + r = kex_kem_sidh_p434_ecdh_nistp256_keypair(kex); + break; + case KEX_KEM_SIDH_P434_COMPRESSED_ECDH_NISTP256_SHA256: + r = kex_kem_sidh_p434_compressed_ecdh_nistp256_keypair(kex); + break; + case KEX_KEM_SIDH_P610_ECDH_NISTP384_SHA256: + r = kex_kem_sidh_p610_ecdh_nistp384_keypair(kex); + break; + case KEX_KEM_SIDH_P610_COMPRESSED_ECDH_NISTP384_SHA256: + r = kex_kem_sidh_p610_compressed_ecdh_nistp384_keypair(kex); + break; + case KEX_KEM_SIDH_P751_ECDH_NISTP521_SHA256: + r = kex_kem_sidh_p751_ecdh_nistp521_keypair(kex); + break; + case KEX_KEM_SIDH_P751_COMPRESSED_ECDH_NISTP521_SHA256: + r = kex_kem_sidh_p751_compressed_ecdh_nistp521_keypair(kex); + break; case KEX_KEM_SIKE_P434_ECDH_NISTP256_SHA256: r = kex_kem_sike_p434_ecdh_nistp256_keypair(kex); break; + case KEX_KEM_SIKE_P434_COMPRESSED_ECDH_NISTP256_SHA256: + r = kex_kem_sike_p434_compressed_ecdh_nistp256_keypair(kex); + break; + case KEX_KEM_SIKE_P610_ECDH_NISTP384_SHA256: + r = kex_kem_sike_p610_ecdh_nistp384_keypair(kex); + break; + case KEX_KEM_SIKE_P610_COMPRESSED_ECDH_NISTP384_SHA256: + r = kex_kem_sike_p610_compressed_ecdh_nistp384_keypair(kex); + break; + case KEX_KEM_SIKE_P751_ECDH_NISTP521_SHA256: + r = kex_kem_sike_p751_ecdh_nistp521_keypair(kex); + break; + case KEX_KEM_SIKE_P751_COMPRESSED_ECDH_NISTP521_SHA256: + r = kex_kem_sike_p751_compressed_ecdh_nistp521_keypair(kex); + break; + case KEX_KEM_SABER_LIGHTSABER_ECDH_NISTP256_SHA256: + r = kex_kem_saber_lightsaber_ecdh_nistp256_keypair(kex); + break; + case KEX_KEM_SABER_SABER_ECDH_NISTP384_SHA384: + r = kex_kem_saber_saber_ecdh_nistp384_keypair(kex); + break; + case KEX_KEM_SABER_FIRESABER_ECDH_NISTP521_SHA512: + r = kex_kem_saber_firesaber_ecdh_nistp521_keypair(kex); + break; + case KEX_KEM_KYBER_512_ECDH_NISTP256_SHA256: + r = kex_kem_kyber_512_ecdh_nistp256_keypair(kex); + break; + case KEX_KEM_KYBER_768_ECDH_NISTP384_SHA384: + r = kex_kem_kyber_768_ecdh_nistp384_keypair(kex); + break; + case KEX_KEM_KYBER_1024_ECDH_NISTP521_SHA512: + r = kex_kem_kyber_1024_ecdh_nistp521_keypair(kex); + break; + case KEX_KEM_KYBER_512_90S_ECDH_NISTP256_SHA256: + r = kex_kem_kyber_512_90s_ecdh_nistp256_keypair(kex); + break; + case KEX_KEM_KYBER_768_90S_ECDH_NISTP384_SHA384: + r = kex_kem_kyber_768_90s_ecdh_nistp384_keypair(kex); + break; + case KEX_KEM_KYBER_1024_90S_ECDH_NISTP521_SHA512: + r = kex_kem_kyber_1024_90s_ecdh_nistp521_keypair(kex); + break; + case KEX_KEM_BIKE1_L1_CPA_ECDH_NISTP256_SHA512: + r = kex_kem_bike1_l1_cpa_ecdh_nistp256_keypair(kex); + break; + case KEX_KEM_BIKE1_L1_FO_ECDH_NISTP256_SHA512: + r = kex_kem_bike1_l1_fo_ecdh_nistp256_keypair(kex); + break; + case KEX_KEM_BIKE1_L3_CPA_ECDH_NISTP384_SHA512: + r = kex_kem_bike1_l3_cpa_ecdh_nistp384_keypair(kex); + break; + case KEX_KEM_BIKE1_L3_FO_ECDH_NISTP384_SHA512: + r = kex_kem_bike1_l3_fo_ecdh_nistp384_keypair(kex); + break; + case KEX_KEM_NTRU_HPS2048509_ECDH_NISTP256_SHA512: + r = kex_kem_ntru_hps2048509_ecdh_nistp256_keypair(kex); + break; + case KEX_KEM_NTRU_HPS2048677_ECDH_NISTP384_SHA512: + r = kex_kem_ntru_hps2048677_ecdh_nistp384_keypair(kex); + break; + case KEX_KEM_NTRU_HRSS701_ECDH_NISTP384_SHA512: + r = kex_kem_ntru_hrss701_ecdh_nistp384_keypair(kex); + break; + case KEX_KEM_NTRU_HPS4096821_ECDH_NISTP521_SHA512: + r = kex_kem_ntru_hps4096821_ecdh_nistp521_keypair(kex); + break; + case KEX_KEM_CLASSIC_MCELIECE_348864_ECDH_NISTP256_SHA256: + r = kex_kem_classic_mceliece_348864_ecdh_nistp256_keypair(kex); + break; + case KEX_KEM_CLASSIC_MCELIECE_348864F_ECDH_NISTP256_SHA256: + r = kex_kem_classic_mceliece_348864f_ecdh_nistp256_keypair(kex); + break; + case KEX_KEM_CLASSIC_MCELIECE_460896_ECDH_NISTP384_SHA512: + r = kex_kem_classic_mceliece_460896_ecdh_nistp384_keypair(kex); + break; + case KEX_KEM_CLASSIC_MCELIECE_460896F_ECDH_NISTP384_SHA512: + r = kex_kem_classic_mceliece_460896f_ecdh_nistp384_keypair(kex); + break; + case KEX_KEM_CLASSIC_MCELIECE_6688128_ECDH_NISTP521_SHA512: + r = kex_kem_classic_mceliece_6688128_ecdh_nistp521_keypair(kex); + break; + case KEX_KEM_CLASSIC_MCELIECE_6688128F_ECDH_NISTP521_SHA512: + r = kex_kem_classic_mceliece_6688128f_ecdh_nistp521_keypair(kex); + break; + case KEX_KEM_CLASSIC_MCELIECE_6960119_ECDH_NISTP521_SHA512: + r = kex_kem_classic_mceliece_6960119_ecdh_nistp521_keypair(kex); + break; + case KEX_KEM_CLASSIC_MCELIECE_6960119F_ECDH_NISTP521_SHA512: + r = kex_kem_classic_mceliece_6960119f_ecdh_nistp521_keypair(kex); + break; + case KEX_KEM_CLASSIC_MCELIECE_8192128_ECDH_NISTP521_SHA512: + r = kex_kem_classic_mceliece_8192128_ecdh_nistp521_keypair(kex); + break; + 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_NTRUPRIME_NTRULPR653_ECDH_NISTP256_SHA256: + r = kex_kem_ntruprime_ntrulpr653_ecdh_nistp256_keypair(kex); + break; + case KEX_KEM_NTRUPRIME_SNTRUP653_ECDH_NISTP256_SHA256: + r = kex_kem_ntruprime_sntrup653_ecdh_nistp256_keypair(kex); + break; + case KEX_KEM_NTRUPRIME_NTRULPR761_ECDH_NISTP384_SHA384: + r = kex_kem_ntruprime_ntrulpr761_ecdh_nistp384_keypair(kex); + break; + case KEX_KEM_NTRUPRIME_SNTRUP761_ECDH_NISTP384_SHA384: + r = kex_kem_ntruprime_sntrup761_ecdh_nistp384_keypair(kex); + break; + case KEX_KEM_NTRUPRIME_NTRULPR857_ECDH_NISTP384_SHA384: + r = kex_kem_ntruprime_ntrulpr857_ecdh_nistp384_keypair(kex); + break; + case KEX_KEM_NTRUPRIME_SNTRUP857_ECDH_NISTP384_SHA384: + r = kex_kem_ntruprime_sntrup857_ecdh_nistp384_keypair(kex); + break; #endif /* OPENSSL_HAS_ECC */ #endif /* WITH_OPENSSL */ ///// OQS_TEMPLATE_FRAGMENT_ADD_CLIENT_SWITCH_CASES_END @@ -239,9 +539,159 @@ input_kex_gen_reply(int type, u_int32_t seq, struct ssh *ssh) case KEX_KEM_FRODOKEM_1344_AES_SHA512: r = kex_kem_frodokem_1344_aes_dec(kex, server_blob, &shared_secret); break; + case KEX_KEM_FRODOKEM_640_SHAKE_SHA256: + r = kex_kem_frodokem_640_shake_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_FRODOKEM_976_SHAKE_SHA384: + r = kex_kem_frodokem_976_shake_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_FRODOKEM_1344_SHAKE_SHA512: + r = kex_kem_frodokem_1344_shake_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_SIDH_P434_SHA256: + r = kex_kem_sidh_p434_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_SIDH_P434_COMPRESSED_SHA256: + r = kex_kem_sidh_p434_compressed_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_SIDH_P610_SHA256: + r = kex_kem_sidh_p610_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_SIDH_P610_COMPRESSED_SHA256: + r = kex_kem_sidh_p610_compressed_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_SIDH_P751_SHA256: + r = kex_kem_sidh_p751_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_SIDH_P751_COMPRESSED_SHA256: + r = kex_kem_sidh_p751_compressed_dec(kex, server_blob, &shared_secret); + break; case KEX_KEM_SIKE_P434_SHA256: r = kex_kem_sike_p434_dec(kex, server_blob, &shared_secret); break; + case KEX_KEM_SIKE_P434_COMPRESSED_SHA256: + r = kex_kem_sike_p434_compressed_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_SIKE_P610_SHA256: + r = kex_kem_sike_p610_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_SIKE_P610_COMPRESSED_SHA256: + r = kex_kem_sike_p610_compressed_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_SIKE_P751_SHA256: + r = kex_kem_sike_p751_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_SIKE_P751_COMPRESSED_SHA256: + r = kex_kem_sike_p751_compressed_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_SABER_LIGHTSABER_SHA256: + r = kex_kem_saber_lightsaber_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_SABER_SABER_SHA384: + r = kex_kem_saber_saber_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_SABER_FIRESABER_SHA512: + r = kex_kem_saber_firesaber_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_KYBER_512_SHA256: + r = kex_kem_kyber_512_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_KYBER_768_SHA384: + r = kex_kem_kyber_768_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_KYBER_1024_SHA512: + r = kex_kem_kyber_1024_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_KYBER_512_90S_SHA256: + r = kex_kem_kyber_512_90s_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_KYBER_768_90S_SHA384: + r = kex_kem_kyber_768_90s_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_KYBER_1024_90S_SHA512: + r = kex_kem_kyber_1024_90s_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_BIKE1_L1_CPA_SHA512: + r = kex_kem_bike1_l1_cpa_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_BIKE1_L1_FO_SHA512: + r = kex_kem_bike1_l1_fo_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_BIKE1_L3_CPA_SHA512: + r = kex_kem_bike1_l3_cpa_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_BIKE1_L3_FO_SHA512: + r = kex_kem_bike1_l3_fo_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_NTRU_HPS2048509_SHA512: + r = kex_kem_ntru_hps2048509_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_NTRU_HPS2048677_SHA512: + r = kex_kem_ntru_hps2048677_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_NTRU_HRSS701_SHA512: + r = kex_kem_ntru_hrss701_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_NTRU_HPS4096821_SHA512: + r = kex_kem_ntru_hps4096821_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_348864_SHA256: + r = kex_kem_classic_mceliece_348864_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_348864F_SHA256: + r = kex_kem_classic_mceliece_348864f_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_460896_SHA512: + r = kex_kem_classic_mceliece_460896_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_460896F_SHA512: + r = kex_kem_classic_mceliece_460896f_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_6688128_SHA512: + r = kex_kem_classic_mceliece_6688128_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_6688128F_SHA512: + r = kex_kem_classic_mceliece_6688128f_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_6960119_SHA512: + r = kex_kem_classic_mceliece_6960119_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_6960119F_SHA512: + r = kex_kem_classic_mceliece_6960119f_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_8192128_SHA512: + r = kex_kem_classic_mceliece_8192128_dec(kex, server_blob, &shared_secret); + break; + 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_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_NTRUPRIME_NTRULPR653_SHA256: + r = kex_kem_ntruprime_ntrulpr653_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_NTRUPRIME_SNTRUP653_SHA256: + r = kex_kem_ntruprime_sntrup653_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_NTRUPRIME_NTRULPR761_SHA384: + r = kex_kem_ntruprime_ntrulpr761_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_NTRUPRIME_SNTRUP761_SHA384: + r = kex_kem_ntruprime_sntrup761_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_NTRUPRIME_NTRULPR857_SHA384: + r = kex_kem_ntruprime_ntrulpr857_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_NTRUPRIME_SNTRUP857_SHA384: + r = kex_kem_ntruprime_sntrup857_dec(kex, server_blob, &shared_secret); + break; #ifdef WITH_OPENSSL #ifdef OPENSSL_HAS_ECC case KEX_KEM_OQS_DEFAULT_ECDH_NISTP256_SHA256: @@ -256,9 +706,159 @@ input_kex_gen_reply(int type, u_int32_t seq, struct ssh *ssh) case KEX_KEM_FRODOKEM_1344_AES_ECDH_NISTP521_SHA512: r = kex_kem_frodokem_1344_aes_ecdh_nistp521_dec(kex, server_blob, &shared_secret); break; + case KEX_KEM_FRODOKEM_640_SHAKE_ECDH_NISTP256_SHA256: + r = kex_kem_frodokem_640_shake_ecdh_nistp256_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_FRODOKEM_976_SHAKE_ECDH_NISTP384_SHA384: + r = kex_kem_frodokem_976_shake_ecdh_nistp384_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_FRODOKEM_1344_SHAKE_ECDH_NISTP521_SHA512: + r = kex_kem_frodokem_1344_shake_ecdh_nistp521_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_SIDH_P434_ECDH_NISTP256_SHA256: + r = kex_kem_sidh_p434_ecdh_nistp256_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_SIDH_P434_COMPRESSED_ECDH_NISTP256_SHA256: + r = kex_kem_sidh_p434_compressed_ecdh_nistp256_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_SIDH_P610_ECDH_NISTP384_SHA256: + r = kex_kem_sidh_p610_ecdh_nistp384_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_SIDH_P610_COMPRESSED_ECDH_NISTP384_SHA256: + r = kex_kem_sidh_p610_compressed_ecdh_nistp384_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_SIDH_P751_ECDH_NISTP521_SHA256: + r = kex_kem_sidh_p751_ecdh_nistp521_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_SIDH_P751_COMPRESSED_ECDH_NISTP521_SHA256: + r = kex_kem_sidh_p751_compressed_ecdh_nistp521_dec(kex, server_blob, &shared_secret); + break; case KEX_KEM_SIKE_P434_ECDH_NISTP256_SHA256: r = kex_kem_sike_p434_ecdh_nistp256_dec(kex, server_blob, &shared_secret); break; + case KEX_KEM_SIKE_P434_COMPRESSED_ECDH_NISTP256_SHA256: + r = kex_kem_sike_p434_compressed_ecdh_nistp256_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_SIKE_P610_ECDH_NISTP384_SHA256: + r = kex_kem_sike_p610_ecdh_nistp384_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_SIKE_P610_COMPRESSED_ECDH_NISTP384_SHA256: + r = kex_kem_sike_p610_compressed_ecdh_nistp384_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_SIKE_P751_ECDH_NISTP521_SHA256: + r = kex_kem_sike_p751_ecdh_nistp521_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_SIKE_P751_COMPRESSED_ECDH_NISTP521_SHA256: + r = kex_kem_sike_p751_compressed_ecdh_nistp521_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_SABER_LIGHTSABER_ECDH_NISTP256_SHA256: + r = kex_kem_saber_lightsaber_ecdh_nistp256_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_SABER_SABER_ECDH_NISTP384_SHA384: + r = kex_kem_saber_saber_ecdh_nistp384_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_SABER_FIRESABER_ECDH_NISTP521_SHA512: + r = kex_kem_saber_firesaber_ecdh_nistp521_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_KYBER_512_ECDH_NISTP256_SHA256: + r = kex_kem_kyber_512_ecdh_nistp256_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_KYBER_768_ECDH_NISTP384_SHA384: + r = kex_kem_kyber_768_ecdh_nistp384_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_KYBER_1024_ECDH_NISTP521_SHA512: + r = kex_kem_kyber_1024_ecdh_nistp521_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_KYBER_512_90S_ECDH_NISTP256_SHA256: + r = kex_kem_kyber_512_90s_ecdh_nistp256_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_KYBER_768_90S_ECDH_NISTP384_SHA384: + r = kex_kem_kyber_768_90s_ecdh_nistp384_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_KYBER_1024_90S_ECDH_NISTP521_SHA512: + r = kex_kem_kyber_1024_90s_ecdh_nistp521_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_BIKE1_L1_CPA_ECDH_NISTP256_SHA512: + r = kex_kem_bike1_l1_cpa_ecdh_nistp256_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_BIKE1_L1_FO_ECDH_NISTP256_SHA512: + r = kex_kem_bike1_l1_fo_ecdh_nistp256_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_BIKE1_L3_CPA_ECDH_NISTP384_SHA512: + r = kex_kem_bike1_l3_cpa_ecdh_nistp384_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_BIKE1_L3_FO_ECDH_NISTP384_SHA512: + r = kex_kem_bike1_l3_fo_ecdh_nistp384_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_NTRU_HPS2048509_ECDH_NISTP256_SHA512: + r = kex_kem_ntru_hps2048509_ecdh_nistp256_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_NTRU_HPS2048677_ECDH_NISTP384_SHA512: + r = kex_kem_ntru_hps2048677_ecdh_nistp384_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_NTRU_HRSS701_ECDH_NISTP384_SHA512: + r = kex_kem_ntru_hrss701_ecdh_nistp384_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_NTRU_HPS4096821_ECDH_NISTP521_SHA512: + r = kex_kem_ntru_hps4096821_ecdh_nistp521_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_348864_ECDH_NISTP256_SHA256: + r = kex_kem_classic_mceliece_348864_ecdh_nistp256_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_348864F_ECDH_NISTP256_SHA256: + r = kex_kem_classic_mceliece_348864f_ecdh_nistp256_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_460896_ECDH_NISTP384_SHA512: + r = kex_kem_classic_mceliece_460896_ecdh_nistp384_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_460896F_ECDH_NISTP384_SHA512: + r = kex_kem_classic_mceliece_460896f_ecdh_nistp384_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_6688128_ECDH_NISTP521_SHA512: + r = kex_kem_classic_mceliece_6688128_ecdh_nistp521_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_6688128F_ECDH_NISTP521_SHA512: + r = kex_kem_classic_mceliece_6688128f_ecdh_nistp521_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_6960119_ECDH_NISTP521_SHA512: + r = kex_kem_classic_mceliece_6960119_ecdh_nistp521_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_6960119F_ECDH_NISTP521_SHA512: + r = kex_kem_classic_mceliece_6960119f_ecdh_nistp521_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_8192128_ECDH_NISTP521_SHA512: + r = kex_kem_classic_mceliece_8192128_ecdh_nistp521_dec(kex, server_blob, &shared_secret); + break; + 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_NTRUPRIME_NTRULPR653_ECDH_NISTP256_SHA256: + r = kex_kem_ntruprime_ntrulpr653_ecdh_nistp256_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_NTRUPRIME_SNTRUP653_ECDH_NISTP256_SHA256: + r = kex_kem_ntruprime_sntrup653_ecdh_nistp256_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_NTRUPRIME_NTRULPR761_ECDH_NISTP384_SHA384: + r = kex_kem_ntruprime_ntrulpr761_ecdh_nistp384_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_NTRUPRIME_SNTRUP761_ECDH_NISTP384_SHA384: + r = kex_kem_ntruprime_sntrup761_ecdh_nistp384_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_NTRUPRIME_NTRULPR857_ECDH_NISTP384_SHA384: + r = kex_kem_ntruprime_ntrulpr857_ecdh_nistp384_dec(kex, server_blob, &shared_secret); + break; + case KEX_KEM_NTRUPRIME_SNTRUP857_ECDH_NISTP384_SHA384: + r = kex_kem_ntruprime_sntrup857_ecdh_nistp384_dec(kex, server_blob, &shared_secret); + break; #endif /* OPENSSL_HAS_ECC */ #endif /* WITH_OPENSSL */ ///// OQS_TEMPLATE_FRAGMENT_ADD_REPLY_SWITCH_CASES_END @@ -381,10 +981,210 @@ input_kex_gen_init(int type, u_int32_t seq, struct ssh *ssh) r = kex_kem_frodokem_1344_aes_enc(kex, client_pubkey, &server_pubkey, &shared_secret); break; + case KEX_KEM_FRODOKEM_640_SHAKE_SHA256: + r = kex_kem_frodokem_640_shake_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_FRODOKEM_976_SHAKE_SHA384: + r = kex_kem_frodokem_976_shake_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_FRODOKEM_1344_SHAKE_SHA512: + r = kex_kem_frodokem_1344_shake_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_SIDH_P434_SHA256: + r = kex_kem_sidh_p434_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_SIDH_P434_COMPRESSED_SHA256: + r = kex_kem_sidh_p434_compressed_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_SIDH_P610_SHA256: + r = kex_kem_sidh_p610_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_SIDH_P610_COMPRESSED_SHA256: + r = kex_kem_sidh_p610_compressed_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_SIDH_P751_SHA256: + r = kex_kem_sidh_p751_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_SIDH_P751_COMPRESSED_SHA256: + r = kex_kem_sidh_p751_compressed_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; case KEX_KEM_SIKE_P434_SHA256: r = kex_kem_sike_p434_enc(kex, client_pubkey, &server_pubkey, &shared_secret); break; + case KEX_KEM_SIKE_P434_COMPRESSED_SHA256: + r = kex_kem_sike_p434_compressed_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_SIKE_P610_SHA256: + r = kex_kem_sike_p610_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_SIKE_P610_COMPRESSED_SHA256: + r = kex_kem_sike_p610_compressed_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_SIKE_P751_SHA256: + r = kex_kem_sike_p751_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_SIKE_P751_COMPRESSED_SHA256: + r = kex_kem_sike_p751_compressed_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_SABER_LIGHTSABER_SHA256: + r = kex_kem_saber_lightsaber_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_SABER_SABER_SHA384: + r = kex_kem_saber_saber_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_SABER_FIRESABER_SHA512: + r = kex_kem_saber_firesaber_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_KYBER_512_SHA256: + r = kex_kem_kyber_512_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_KYBER_768_SHA384: + r = kex_kem_kyber_768_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_KYBER_1024_SHA512: + r = kex_kem_kyber_1024_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_KYBER_512_90S_SHA256: + r = kex_kem_kyber_512_90s_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_KYBER_768_90S_SHA384: + r = kex_kem_kyber_768_90s_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_KYBER_1024_90S_SHA512: + r = kex_kem_kyber_1024_90s_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_BIKE1_L1_CPA_SHA512: + r = kex_kem_bike1_l1_cpa_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_BIKE1_L1_FO_SHA512: + r = kex_kem_bike1_l1_fo_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_BIKE1_L3_CPA_SHA512: + r = kex_kem_bike1_l3_cpa_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_BIKE1_L3_FO_SHA512: + r = kex_kem_bike1_l3_fo_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_NTRU_HPS2048509_SHA512: + r = kex_kem_ntru_hps2048509_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_NTRU_HPS2048677_SHA512: + r = kex_kem_ntru_hps2048677_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_NTRU_HRSS701_SHA512: + r = kex_kem_ntru_hrss701_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_NTRU_HPS4096821_SHA512: + r = kex_kem_ntru_hps4096821_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_348864_SHA256: + r = kex_kem_classic_mceliece_348864_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_348864F_SHA256: + r = kex_kem_classic_mceliece_348864f_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_460896_SHA512: + r = kex_kem_classic_mceliece_460896_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_460896F_SHA512: + r = kex_kem_classic_mceliece_460896f_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_6688128_SHA512: + r = kex_kem_classic_mceliece_6688128_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_6688128F_SHA512: + r = kex_kem_classic_mceliece_6688128f_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_6960119_SHA512: + r = kex_kem_classic_mceliece_6960119_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_6960119F_SHA512: + r = kex_kem_classic_mceliece_6960119f_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_8192128_SHA512: + r = kex_kem_classic_mceliece_8192128_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_8192128F_SHA512: + 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_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_NTRUPRIME_NTRULPR653_SHA256: + r = kex_kem_ntruprime_ntrulpr653_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_NTRUPRIME_SNTRUP653_SHA256: + r = kex_kem_ntruprime_sntrup653_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_NTRUPRIME_NTRULPR761_SHA384: + r = kex_kem_ntruprime_ntrulpr761_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_NTRUPRIME_SNTRUP761_SHA384: + r = kex_kem_ntruprime_sntrup761_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_NTRUPRIME_NTRULPR857_SHA384: + r = kex_kem_ntruprime_ntrulpr857_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_NTRUPRIME_SNTRUP857_SHA384: + r = kex_kem_ntruprime_sntrup857_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; #ifdef WITH_OPENSSL #ifdef OPENSSL_HAS_ECC case KEX_KEM_OQS_DEFAULT_ECDH_NISTP256_SHA256: @@ -403,10 +1203,210 @@ input_kex_gen_init(int type, u_int32_t seq, struct ssh *ssh) r = kex_kem_frodokem_1344_aes_ecdh_nistp521_enc(kex, client_pubkey, &server_pubkey, &shared_secret); break; + case KEX_KEM_FRODOKEM_640_SHAKE_ECDH_NISTP256_SHA256: + r = kex_kem_frodokem_640_shake_ecdh_nistp256_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_FRODOKEM_976_SHAKE_ECDH_NISTP384_SHA384: + r = kex_kem_frodokem_976_shake_ecdh_nistp384_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_FRODOKEM_1344_SHAKE_ECDH_NISTP521_SHA512: + r = kex_kem_frodokem_1344_shake_ecdh_nistp521_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_SIDH_P434_ECDH_NISTP256_SHA256: + r = kex_kem_sidh_p434_ecdh_nistp256_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_SIDH_P434_COMPRESSED_ECDH_NISTP256_SHA256: + r = kex_kem_sidh_p434_compressed_ecdh_nistp256_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_SIDH_P610_ECDH_NISTP384_SHA256: + r = kex_kem_sidh_p610_ecdh_nistp384_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_SIDH_P610_COMPRESSED_ECDH_NISTP384_SHA256: + r = kex_kem_sidh_p610_compressed_ecdh_nistp384_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_SIDH_P751_ECDH_NISTP521_SHA256: + r = kex_kem_sidh_p751_ecdh_nistp521_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_SIDH_P751_COMPRESSED_ECDH_NISTP521_SHA256: + r = kex_kem_sidh_p751_compressed_ecdh_nistp521_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; case KEX_KEM_SIKE_P434_ECDH_NISTP256_SHA256: r = kex_kem_sike_p434_ecdh_nistp256_enc(kex, client_pubkey, &server_pubkey, &shared_secret); break; + case KEX_KEM_SIKE_P434_COMPRESSED_ECDH_NISTP256_SHA256: + r = kex_kem_sike_p434_compressed_ecdh_nistp256_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_SIKE_P610_ECDH_NISTP384_SHA256: + r = kex_kem_sike_p610_ecdh_nistp384_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_SIKE_P610_COMPRESSED_ECDH_NISTP384_SHA256: + r = kex_kem_sike_p610_compressed_ecdh_nistp384_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_SIKE_P751_ECDH_NISTP521_SHA256: + r = kex_kem_sike_p751_ecdh_nistp521_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_SIKE_P751_COMPRESSED_ECDH_NISTP521_SHA256: + r = kex_kem_sike_p751_compressed_ecdh_nistp521_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_SABER_LIGHTSABER_ECDH_NISTP256_SHA256: + r = kex_kem_saber_lightsaber_ecdh_nistp256_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_SABER_SABER_ECDH_NISTP384_SHA384: + r = kex_kem_saber_saber_ecdh_nistp384_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_SABER_FIRESABER_ECDH_NISTP521_SHA512: + r = kex_kem_saber_firesaber_ecdh_nistp521_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_KYBER_512_ECDH_NISTP256_SHA256: + r = kex_kem_kyber_512_ecdh_nistp256_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_KYBER_768_ECDH_NISTP384_SHA384: + r = kex_kem_kyber_768_ecdh_nistp384_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_KYBER_1024_ECDH_NISTP521_SHA512: + r = kex_kem_kyber_1024_ecdh_nistp521_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_KYBER_512_90S_ECDH_NISTP256_SHA256: + r = kex_kem_kyber_512_90s_ecdh_nistp256_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_KYBER_768_90S_ECDH_NISTP384_SHA384: + r = kex_kem_kyber_768_90s_ecdh_nistp384_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_KYBER_1024_90S_ECDH_NISTP521_SHA512: + r = kex_kem_kyber_1024_90s_ecdh_nistp521_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_BIKE1_L1_CPA_ECDH_NISTP256_SHA512: + r = kex_kem_bike1_l1_cpa_ecdh_nistp256_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_BIKE1_L1_FO_ECDH_NISTP256_SHA512: + r = kex_kem_bike1_l1_fo_ecdh_nistp256_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_BIKE1_L3_CPA_ECDH_NISTP384_SHA512: + r = kex_kem_bike1_l3_cpa_ecdh_nistp384_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_BIKE1_L3_FO_ECDH_NISTP384_SHA512: + r = kex_kem_bike1_l3_fo_ecdh_nistp384_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_NTRU_HPS2048509_ECDH_NISTP256_SHA512: + r = kex_kem_ntru_hps2048509_ecdh_nistp256_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_NTRU_HPS2048677_ECDH_NISTP384_SHA512: + r = kex_kem_ntru_hps2048677_ecdh_nistp384_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_NTRU_HRSS701_ECDH_NISTP384_SHA512: + r = kex_kem_ntru_hrss701_ecdh_nistp384_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_NTRU_HPS4096821_ECDH_NISTP521_SHA512: + r = kex_kem_ntru_hps4096821_ecdh_nistp521_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_348864_ECDH_NISTP256_SHA256: + r = kex_kem_classic_mceliece_348864_ecdh_nistp256_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_348864F_ECDH_NISTP256_SHA256: + r = kex_kem_classic_mceliece_348864f_ecdh_nistp256_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_460896_ECDH_NISTP384_SHA512: + r = kex_kem_classic_mceliece_460896_ecdh_nistp384_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_460896F_ECDH_NISTP384_SHA512: + r = kex_kem_classic_mceliece_460896f_ecdh_nistp384_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_6688128_ECDH_NISTP521_SHA512: + r = kex_kem_classic_mceliece_6688128_ecdh_nistp521_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_6688128F_ECDH_NISTP521_SHA512: + r = kex_kem_classic_mceliece_6688128f_ecdh_nistp521_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_6960119_ECDH_NISTP521_SHA512: + r = kex_kem_classic_mceliece_6960119_ecdh_nistp521_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_6960119F_ECDH_NISTP521_SHA512: + r = kex_kem_classic_mceliece_6960119f_ecdh_nistp521_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_8192128_ECDH_NISTP521_SHA512: + r = kex_kem_classic_mceliece_8192128_ecdh_nistp521_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_CLASSIC_MCELIECE_8192128F_ECDH_NISTP521_SHA512: + 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_NTRUPRIME_NTRULPR653_ECDH_NISTP256_SHA256: + r = kex_kem_ntruprime_ntrulpr653_ecdh_nistp256_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_NTRUPRIME_SNTRUP653_ECDH_NISTP256_SHA256: + r = kex_kem_ntruprime_sntrup653_ecdh_nistp256_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_NTRUPRIME_NTRULPR761_ECDH_NISTP384_SHA384: + r = kex_kem_ntruprime_ntrulpr761_ecdh_nistp384_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_NTRUPRIME_SNTRUP761_ECDH_NISTP384_SHA384: + r = kex_kem_ntruprime_sntrup761_ecdh_nistp384_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_NTRUPRIME_NTRULPR857_ECDH_NISTP384_SHA384: + r = kex_kem_ntruprime_ntrulpr857_ecdh_nistp384_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; + case KEX_KEM_NTRUPRIME_SNTRUP857_ECDH_NISTP384_SHA384: + r = kex_kem_ntruprime_sntrup857_ecdh_nistp384_enc(kex, client_pubkey, + &server_pubkey, &shared_secret); + break; #endif /* OPENSSL_HAS_ECC */ #endif /* WITH_OPENSSL */ ///// OQS_TEMPLATE_FRAGMENT_ADD_INIT_SWITCH_CASES_END diff --git a/kexoqs.c b/kexoqs.c index eb6b580ec524..9e25c1813af6 100644 --- a/kexoqs.c +++ b/kexoqs.c @@ -300,13 +300,1733 @@ int kex_kem_frodokem_1344_aes_dec(struct kex *kex, OQS_KEM_free(kem); return r; } +/*--------------------------------------------------- + * FRODOKEM_640_SHAKE METHODS + *--------------------------------------------------- + */ +int kex_kem_frodokem_640_shake_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_frodokem_640_shake); + 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_frodokem_640_shake_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_frodokem_640_shake); + 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_frodokem_640_shake_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_frodokem_640_shake); + 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; +} +/*--------------------------------------------------- + * FRODOKEM_976_SHAKE METHODS + *--------------------------------------------------- + */ +int kex_kem_frodokem_976_shake_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_frodokem_976_shake); + 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_frodokem_976_shake_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_frodokem_976_shake); + 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_frodokem_976_shake_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_frodokem_976_shake); + 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; +} +/*--------------------------------------------------- + * FRODOKEM_1344_SHAKE METHODS + *--------------------------------------------------- + */ +int kex_kem_frodokem_1344_shake_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_frodokem_1344_shake); + 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_frodokem_1344_shake_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_frodokem_1344_shake); + 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_frodokem_1344_shake_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_frodokem_1344_shake); + 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; +} +/*--------------------------------------------------- + * SIDH_P434 METHODS + *--------------------------------------------------- + */ +int kex_kem_sidh_p434_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sidh_p434); + 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_sidh_p434_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_sidh_p434); + 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_sidh_p434_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sidh_p434); + 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; +} +/*--------------------------------------------------- + * SIDH_P434_COMPRESSED METHODS + *--------------------------------------------------- + */ +int kex_kem_sidh_p434_compressed_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sidh_p434_compressed); + 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_sidh_p434_compressed_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_sidh_p434_compressed); + 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_sidh_p434_compressed_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sidh_p434_compressed); + 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; +} +/*--------------------------------------------------- + * SIDH_P610 METHODS + *--------------------------------------------------- + */ +int kex_kem_sidh_p610_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sidh_p610); + 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_sidh_p610_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_sidh_p610); + 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_sidh_p610_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sidh_p610); + 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; +} +/*--------------------------------------------------- + * SIDH_P610_COMPRESSED METHODS + *--------------------------------------------------- + */ +int kex_kem_sidh_p610_compressed_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sidh_p610_compressed); + 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_sidh_p610_compressed_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_sidh_p610_compressed); + 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_sidh_p610_compressed_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sidh_p610_compressed); + 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; +} +/*--------------------------------------------------- + * SIDH_P751 METHODS + *--------------------------------------------------- + */ +int kex_kem_sidh_p751_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sidh_p751); + 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_sidh_p751_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_sidh_p751); + 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_sidh_p751_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sidh_p751); + 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; +} +/*--------------------------------------------------- + * SIDH_P751_COMPRESSED METHODS + *--------------------------------------------------- + */ +int kex_kem_sidh_p751_compressed_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sidh_p751_compressed); + 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_sidh_p751_compressed_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_sidh_p751_compressed); + 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_sidh_p751_compressed_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sidh_p751_compressed); + 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; +} /*--------------------------------------------------- * SIKE_P434 METHODS *--------------------------------------------------- */ -int kex_kem_sike_p434_keypair(struct kex *kex) +int kex_kem_sike_p434_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sike_p434); + 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_sike_p434_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_sike_p434); + 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_sike_p434_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sike_p434); + 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; +} +/*--------------------------------------------------- + * SIKE_P434_COMPRESSED METHODS + *--------------------------------------------------- + */ +int kex_kem_sike_p434_compressed_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sike_p434_compressed); + 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_sike_p434_compressed_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_sike_p434_compressed); + 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_sike_p434_compressed_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sike_p434_compressed); + 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; +} +/*--------------------------------------------------- + * SIKE_P610 METHODS + *--------------------------------------------------- + */ +int kex_kem_sike_p610_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sike_p610); + 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_sike_p610_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_sike_p610); + 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_sike_p610_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sike_p610); + 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; +} +/*--------------------------------------------------- + * SIKE_P610_COMPRESSED METHODS + *--------------------------------------------------- + */ +int kex_kem_sike_p610_compressed_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sike_p610_compressed); + 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_sike_p610_compressed_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_sike_p610_compressed); + 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_sike_p610_compressed_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sike_p610_compressed); + 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; +} +/*--------------------------------------------------- + * SIKE_P751 METHODS + *--------------------------------------------------- + */ +int kex_kem_sike_p751_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sike_p751); + 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_sike_p751_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_sike_p751); + 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_sike_p751_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sike_p751); + 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; +} +/*--------------------------------------------------- + * SIKE_P751_COMPRESSED METHODS + *--------------------------------------------------- + */ +int kex_kem_sike_p751_compressed_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sike_p751_compressed); + 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_sike_p751_compressed_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_sike_p751_compressed); + 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_sike_p751_compressed_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sike_p751_compressed); + 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; +} +/*--------------------------------------------------- + * SABER_LIGHTSABER METHODS + *--------------------------------------------------- + */ +int kex_kem_saber_lightsaber_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_saber_lightsaber); + 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_saber_lightsaber_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_saber_lightsaber); + 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_saber_lightsaber_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_saber_lightsaber); + 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; +} +/*--------------------------------------------------- + * SABER_SABER METHODS + *--------------------------------------------------- + */ +int kex_kem_saber_saber_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_saber_saber); + 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_saber_saber_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_saber_saber); + 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_saber_saber_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_saber_saber); + 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; +} +/*--------------------------------------------------- + * SABER_FIRESABER METHODS + *--------------------------------------------------- + */ +int kex_kem_saber_firesaber_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_saber_firesaber); + 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_saber_firesaber_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_saber_firesaber); + 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_saber_firesaber_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_saber_firesaber); + 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; +} +/*--------------------------------------------------- + * KYBER_512 METHODS + *--------------------------------------------------- + */ +int kex_kem_kyber_512_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_kyber_512); + 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_kyber_512_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_kyber_512); + 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_kyber_512_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_kyber_512); + 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; +} +/*--------------------------------------------------- + * KYBER_768 METHODS + *--------------------------------------------------- + */ +int kex_kem_kyber_768_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_kyber_768); + 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_kyber_768_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_kyber_768); + 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_kyber_768_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_kyber_768); + 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; +} +/*--------------------------------------------------- + * KYBER_1024 METHODS + *--------------------------------------------------- + */ +int kex_kem_kyber_1024_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_kyber_1024); + 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_kyber_1024_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_kyber_1024); + 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_kyber_1024_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_kyber_1024); + 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; +} +/*--------------------------------------------------- + * KYBER_512_90S METHODS + *--------------------------------------------------- + */ +int kex_kem_kyber_512_90s_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_kyber_512_90s); + 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_kyber_512_90s_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_kyber_512_90s); + 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_kyber_512_90s_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_kyber_512_90s); + 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; +} +/*--------------------------------------------------- + * KYBER_768_90S METHODS + *--------------------------------------------------- + */ +int kex_kem_kyber_768_90s_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_kyber_768_90s); + 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_kyber_768_90s_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_kyber_768_90s); + 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_kyber_768_90s_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_kyber_768_90s); + 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; +} +/*--------------------------------------------------- + * KYBER_1024_90S METHODS + *--------------------------------------------------- + */ +int kex_kem_kyber_1024_90s_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_kyber_1024_90s); + 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_kyber_1024_90s_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_kyber_1024_90s); + 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_kyber_1024_90s_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_kyber_1024_90s); + 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; +} +/*--------------------------------------------------- + * BIKE1_L1_CPA METHODS + *--------------------------------------------------- + */ +int kex_kem_bike1_l1_cpa_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_bike1_l1_cpa); + 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_bike1_l1_cpa_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_bike1_l1_cpa); + 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_bike1_l1_cpa_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_bike1_l1_cpa); + 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; +} +/*--------------------------------------------------- + * BIKE1_L1_FO METHODS + *--------------------------------------------------- + */ +int kex_kem_bike1_l1_fo_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_bike1_l1_fo); + 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_bike1_l1_fo_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_bike1_l1_fo); + 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_bike1_l1_fo_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_bike1_l1_fo); + 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; +} +/*--------------------------------------------------- + * BIKE1_L3_CPA METHODS + *--------------------------------------------------- + */ +int kex_kem_bike1_l3_cpa_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_bike1_l3_cpa); + 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_bike1_l3_cpa_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_bike1_l3_cpa); + 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_bike1_l3_cpa_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_bike1_l3_cpa); + 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; +} +/*--------------------------------------------------- + * BIKE1_L3_FO METHODS + *--------------------------------------------------- + */ +int kex_kem_bike1_l3_fo_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_bike1_l3_fo); + 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_bike1_l3_fo_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_bike1_l3_fo); + 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_bike1_l3_fo_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_bike1_l3_fo); + 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; +} +/*--------------------------------------------------- + * NTRU_HPS2048509 METHODS + *--------------------------------------------------- + */ +int kex_kem_ntru_hps2048509_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntru_hps2048509); + 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_ntru_hps2048509_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_ntru_hps2048509); + 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_ntru_hps2048509_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntru_hps2048509); + 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; +} +/*--------------------------------------------------- + * NTRU_HPS2048677 METHODS + *--------------------------------------------------- + */ +int kex_kem_ntru_hps2048677_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntru_hps2048677); + 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_ntru_hps2048677_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_ntru_hps2048677); + 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_ntru_hps2048677_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntru_hps2048677); + 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; +} +/*--------------------------------------------------- + * NTRU_HRSS701 METHODS + *--------------------------------------------------- + */ +int kex_kem_ntru_hrss701_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntru_hrss701); + 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_ntru_hrss701_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_ntru_hrss701); + 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_ntru_hrss701_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntru_hrss701); + 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; +} +/*--------------------------------------------------- + * NTRU_HPS4096821 METHODS + *--------------------------------------------------- + */ +int kex_kem_ntru_hps4096821_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntru_hps4096821); + 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_ntru_hps4096821_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_ntru_hps4096821); + 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_ntru_hps4096821_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntru_hps4096821); + 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; +} +/*--------------------------------------------------- + * CLASSIC_MCELIECE_348864 METHODS + *--------------------------------------------------- + */ +int kex_kem_classic_mceliece_348864_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_348864); + 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_classic_mceliece_348864_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_classic_mceliece_348864); + 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_classic_mceliece_348864_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_348864); + 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; +} +/*--------------------------------------------------- + * CLASSIC_MCELIECE_348864F METHODS + *--------------------------------------------------- + */ +int kex_kem_classic_mceliece_348864f_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_348864f); + 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_classic_mceliece_348864f_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_classic_mceliece_348864f); + 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_classic_mceliece_348864f_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_348864f); + 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; +} +/*--------------------------------------------------- + * CLASSIC_MCELIECE_460896 METHODS + *--------------------------------------------------- + */ +int kex_kem_classic_mceliece_460896_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_460896); + 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_classic_mceliece_460896_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_classic_mceliece_460896); + 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_classic_mceliece_460896_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_460896); + 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; +} +/*--------------------------------------------------- + * CLASSIC_MCELIECE_460896F METHODS + *--------------------------------------------------- + */ +int kex_kem_classic_mceliece_460896f_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_460896f); + 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_classic_mceliece_460896f_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_classic_mceliece_460896f); + 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_classic_mceliece_460896f_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_460896f); + 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; +} +/*--------------------------------------------------- + * CLASSIC_MCELIECE_6688128 METHODS + *--------------------------------------------------- + */ +int kex_kem_classic_mceliece_6688128_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_6688128); + 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_classic_mceliece_6688128_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_classic_mceliece_6688128); + 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_classic_mceliece_6688128_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_6688128); + 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; +} +/*--------------------------------------------------- + * CLASSIC_MCELIECE_6688128F METHODS + *--------------------------------------------------- + */ +int kex_kem_classic_mceliece_6688128f_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_6688128f); + 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_classic_mceliece_6688128f_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_classic_mceliece_6688128f); + 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_classic_mceliece_6688128f_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_6688128f); + 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; +} +/*--------------------------------------------------- + * CLASSIC_MCELIECE_6960119 METHODS + *--------------------------------------------------- + */ +int kex_kem_classic_mceliece_6960119_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_6960119); + 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_classic_mceliece_6960119_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_classic_mceliece_6960119); + 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_classic_mceliece_6960119_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_6960119); + 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; +} +/*--------------------------------------------------- + * CLASSIC_MCELIECE_6960119F METHODS + *--------------------------------------------------- + */ +int kex_kem_classic_mceliece_6960119f_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_6960119f); + 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_classic_mceliece_6960119f_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_classic_mceliece_6960119f); + 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_classic_mceliece_6960119f_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_6960119f); + 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; +} +/*--------------------------------------------------- + * CLASSIC_MCELIECE_8192128 METHODS + *--------------------------------------------------- + */ +int kex_kem_classic_mceliece_8192128_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_8192128); + 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_classic_mceliece_8192128_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_classic_mceliece_8192128); + 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_classic_mceliece_8192128_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_8192128); + 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; +} +/*--------------------------------------------------- + * CLASSIC_MCELIECE_8192128F METHODS + *--------------------------------------------------- + */ +int kex_kem_classic_mceliece_8192128f_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_8192128f); + 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_classic_mceliece_8192128f_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_classic_mceliece_8192128f); + 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_classic_mceliece_8192128f_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_8192128f); + 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_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_sike_p434); + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_hqc_192); if (kem == NULL) { return SSH_ERR_ALLOC_FAIL; } @@ -314,12 +2034,12 @@ int kex_kem_sike_p434_keypair(struct kex *kex) OQS_KEM_free(kem); return r; } -int kex_kem_sike_p434_enc(struct kex *kex, +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_sike_p434); + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_hqc_192); if (kem == NULL) { return SSH_ERR_ALLOC_FAIL; } @@ -328,11 +2048,291 @@ int kex_kem_sike_p434_enc(struct kex *kex, return r; } -int kex_kem_sike_p434_dec(struct kex *kex, +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_sike_p434); + 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; +} +/*--------------------------------------------------- + * NTRUPRIME_NTRULPR653 METHODS + *--------------------------------------------------- + */ +int kex_kem_ntruprime_ntrulpr653_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntruprime_ntrulpr653); + 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_ntruprime_ntrulpr653_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_ntruprime_ntrulpr653); + 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_ntruprime_ntrulpr653_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntruprime_ntrulpr653); + 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; +} +/*--------------------------------------------------- + * NTRUPRIME_SNTRUP653 METHODS + *--------------------------------------------------- + */ +int kex_kem_ntruprime_sntrup653_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntruprime_sntrup653); + 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_ntruprime_sntrup653_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_ntruprime_sntrup653); + 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_ntruprime_sntrup653_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntruprime_sntrup653); + 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; +} +/*--------------------------------------------------- + * NTRUPRIME_NTRULPR761 METHODS + *--------------------------------------------------- + */ +int kex_kem_ntruprime_ntrulpr761_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntruprime_ntrulpr761); + 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_ntruprime_ntrulpr761_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_ntruprime_ntrulpr761); + 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_ntruprime_ntrulpr761_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntruprime_ntrulpr761); + 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; +} +/*--------------------------------------------------- + * NTRUPRIME_SNTRUP761 METHODS + *--------------------------------------------------- + */ +int kex_kem_ntruprime_sntrup761_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntruprime_sntrup761); + 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_ntruprime_sntrup761_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_ntruprime_sntrup761); + 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_ntruprime_sntrup761_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntruprime_sntrup761); + 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; +} +/*--------------------------------------------------- + * NTRUPRIME_NTRULPR857 METHODS + *--------------------------------------------------- + */ +int kex_kem_ntruprime_ntrulpr857_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntruprime_ntrulpr857); + 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_ntruprime_ntrulpr857_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_ntruprime_ntrulpr857); + 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_ntruprime_ntrulpr857_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntruprime_ntrulpr857); + 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; +} +/*--------------------------------------------------- + * NTRUPRIME_SNTRUP857 METHODS + *--------------------------------------------------- + */ +int kex_kem_ntruprime_sntrup857_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntruprime_sntrup857); + 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_ntruprime_sntrup857_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_ntruprime_sntrup857); + 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_ntruprime_sntrup857_dec(struct kex *kex, + const struct sshbuf *server_blob, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntruprime_sntrup857); if (kem == NULL) { return SSH_ERR_ALLOC_FAIL; } diff --git a/kexoqsecdh.c b/kexoqsecdh.c index 079af1dbdaba..25845e4de011 100644 --- a/kexoqsecdh.c +++ b/kexoqsecdh.c @@ -517,13 +517,1776 @@ int kex_kem_frodokem_1344_aes_ecdh_nistp521_dec(struct kex *kex, OQS_KEM_free(kem); return r; } +/*--------------------------------------------------------------- + * FRODOKEM_640_SHAKE_ECDH_NISTP256 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_frodokem_640_shake_ecdh_nistp256_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_frodokem_640_shake); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_frodokem_640_shake_ecdh_nistp256_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_frodokem_640_shake); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_frodokem_640_shake_ecdh_nistp256_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_frodokem_640_shake); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * FRODOKEM_976_SHAKE_ECDH_NISTP384 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_frodokem_976_shake_ecdh_nistp384_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_frodokem_976_shake); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_frodokem_976_shake_ecdh_nistp384_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_frodokem_976_shake); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_frodokem_976_shake_ecdh_nistp384_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_frodokem_976_shake); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * FRODOKEM_1344_SHAKE_ECDH_NISTP521 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_frodokem_1344_shake_ecdh_nistp521_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_frodokem_1344_shake); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_frodokem_1344_shake_ecdh_nistp521_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_frodokem_1344_shake); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_frodokem_1344_shake_ecdh_nistp521_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_frodokem_1344_shake); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * SIDH_P434_ECDH_NISTP256 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_sidh_p434_ecdh_nistp256_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sidh_p434); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_sidh_p434_ecdh_nistp256_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_sidh_p434); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_sidh_p434_ecdh_nistp256_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sidh_p434); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * SIDH_P434_COMPRESSED_ECDH_NISTP256 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_sidh_p434_compressed_ecdh_nistp256_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sidh_p434_compressed); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_sidh_p434_compressed_ecdh_nistp256_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_sidh_p434_compressed); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_sidh_p434_compressed_ecdh_nistp256_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sidh_p434_compressed); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * SIDH_P610_ECDH_NISTP384 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_sidh_p610_ecdh_nistp384_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sidh_p610); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_sidh_p610_ecdh_nistp384_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_sidh_p610); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_sidh_p610_ecdh_nistp384_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sidh_p610); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * SIDH_P610_COMPRESSED_ECDH_NISTP384 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_sidh_p610_compressed_ecdh_nistp384_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sidh_p610_compressed); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_sidh_p610_compressed_ecdh_nistp384_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_sidh_p610_compressed); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_sidh_p610_compressed_ecdh_nistp384_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sidh_p610_compressed); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * SIDH_P751_ECDH_NISTP521 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_sidh_p751_ecdh_nistp521_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sidh_p751); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_sidh_p751_ecdh_nistp521_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_sidh_p751); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_sidh_p751_ecdh_nistp521_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sidh_p751); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * SIDH_P751_COMPRESSED_ECDH_NISTP521 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_sidh_p751_compressed_ecdh_nistp521_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sidh_p751_compressed); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_sidh_p751_compressed_ecdh_nistp521_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_sidh_p751_compressed); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_sidh_p751_compressed_ecdh_nistp521_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sidh_p751_compressed); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} /*--------------------------------------------------------------- * SIKE_P434_ECDH_NISTP256 METHODS *--------------------------------------------------------------- */ -int kex_kem_sike_p434_ecdh_nistp256_keypair(struct kex *kex) +int kex_kem_sike_p434_ecdh_nistp256_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sike_p434); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_sike_p434_ecdh_nistp256_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_sike_p434); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_sike_p434_ecdh_nistp256_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sike_p434); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * SIKE_P434_COMPRESSED_ECDH_NISTP256 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_sike_p434_compressed_ecdh_nistp256_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sike_p434_compressed); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_sike_p434_compressed_ecdh_nistp256_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_sike_p434_compressed); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_sike_p434_compressed_ecdh_nistp256_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sike_p434_compressed); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * SIKE_P610_ECDH_NISTP384 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_sike_p610_ecdh_nistp384_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sike_p610); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_sike_p610_ecdh_nistp384_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_sike_p610); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_sike_p610_ecdh_nistp384_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sike_p610); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * SIKE_P610_COMPRESSED_ECDH_NISTP384 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_sike_p610_compressed_ecdh_nistp384_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sike_p610_compressed); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_sike_p610_compressed_ecdh_nistp384_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_sike_p610_compressed); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_sike_p610_compressed_ecdh_nistp384_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sike_p610_compressed); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * SIKE_P751_ECDH_NISTP521 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_sike_p751_ecdh_nistp521_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sike_p751); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_sike_p751_ecdh_nistp521_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_sike_p751); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_sike_p751_ecdh_nistp521_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sike_p751); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * SIKE_P751_COMPRESSED_ECDH_NISTP521 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_sike_p751_compressed_ecdh_nistp521_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sike_p751_compressed); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_sike_p751_compressed_ecdh_nistp521_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_sike_p751_compressed); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_sike_p751_compressed_ecdh_nistp521_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sike_p751_compressed); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * SABER_LIGHTSABER_ECDH_NISTP256 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_saber_lightsaber_ecdh_nistp256_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_saber_lightsaber); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_saber_lightsaber_ecdh_nistp256_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_saber_lightsaber); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_saber_lightsaber_ecdh_nistp256_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_saber_lightsaber); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * SABER_SABER_ECDH_NISTP384 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_saber_saber_ecdh_nistp384_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_saber_saber); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_saber_saber_ecdh_nistp384_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_saber_saber); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_saber_saber_ecdh_nistp384_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_saber_saber); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * SABER_FIRESABER_ECDH_NISTP521 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_saber_firesaber_ecdh_nistp521_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_saber_firesaber); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_saber_firesaber_ecdh_nistp521_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_saber_firesaber); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_saber_firesaber_ecdh_nistp521_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_saber_firesaber); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * KYBER_512_ECDH_NISTP256 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_kyber_512_ecdh_nistp256_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_kyber_512); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_kyber_512_ecdh_nistp256_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_kyber_512); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_kyber_512_ecdh_nistp256_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_kyber_512); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * KYBER_768_ECDH_NISTP384 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_kyber_768_ecdh_nistp384_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_kyber_768); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_kyber_768_ecdh_nistp384_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_kyber_768); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_kyber_768_ecdh_nistp384_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_kyber_768); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * KYBER_1024_ECDH_NISTP521 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_kyber_1024_ecdh_nistp521_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_kyber_1024); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_kyber_1024_ecdh_nistp521_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_kyber_1024); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_kyber_1024_ecdh_nistp521_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_kyber_1024); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * KYBER_512_90S_ECDH_NISTP256 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_kyber_512_90s_ecdh_nistp256_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_kyber_512_90s); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_kyber_512_90s_ecdh_nistp256_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_kyber_512_90s); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_kyber_512_90s_ecdh_nistp256_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_kyber_512_90s); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * KYBER_768_90S_ECDH_NISTP384 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_kyber_768_90s_ecdh_nistp384_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_kyber_768_90s); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_kyber_768_90s_ecdh_nistp384_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_kyber_768_90s); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_kyber_768_90s_ecdh_nistp384_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_kyber_768_90s); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * KYBER_1024_90S_ECDH_NISTP521 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_kyber_1024_90s_ecdh_nistp521_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_kyber_1024_90s); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_kyber_1024_90s_ecdh_nistp521_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_kyber_1024_90s); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_kyber_1024_90s_ecdh_nistp521_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_kyber_1024_90s); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * BIKE1_L1_CPA_ECDH_NISTP256 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_bike1_l1_cpa_ecdh_nistp256_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_bike1_l1_cpa); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_bike1_l1_cpa_ecdh_nistp256_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_bike1_l1_cpa); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_bike1_l1_cpa_ecdh_nistp256_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_bike1_l1_cpa); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * BIKE1_L1_FO_ECDH_NISTP256 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_bike1_l1_fo_ecdh_nistp256_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_bike1_l1_fo); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_bike1_l1_fo_ecdh_nistp256_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_bike1_l1_fo); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_bike1_l1_fo_ecdh_nistp256_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_bike1_l1_fo); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * BIKE1_L3_CPA_ECDH_NISTP384 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_bike1_l3_cpa_ecdh_nistp384_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_bike1_l3_cpa); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_bike1_l3_cpa_ecdh_nistp384_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_bike1_l3_cpa); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_bike1_l3_cpa_ecdh_nistp384_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_bike1_l3_cpa); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * BIKE1_L3_FO_ECDH_NISTP384 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_bike1_l3_fo_ecdh_nistp384_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_bike1_l3_fo); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_bike1_l3_fo_ecdh_nistp384_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_bike1_l3_fo); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_bike1_l3_fo_ecdh_nistp384_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_bike1_l3_fo); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * NTRU_HPS2048509_ECDH_NISTP256 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_ntru_hps2048509_ecdh_nistp256_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntru_hps2048509); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_ntru_hps2048509_ecdh_nistp256_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_ntru_hps2048509); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_ntru_hps2048509_ecdh_nistp256_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntru_hps2048509); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * NTRU_HPS2048677_ECDH_NISTP384 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_ntru_hps2048677_ecdh_nistp384_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntru_hps2048677); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_ntru_hps2048677_ecdh_nistp384_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_ntru_hps2048677); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_ntru_hps2048677_ecdh_nistp384_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntru_hps2048677); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * NTRU_HRSS701_ECDH_NISTP384 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_ntru_hrss701_ecdh_nistp384_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntru_hrss701); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_ntru_hrss701_ecdh_nistp384_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_ntru_hrss701); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_ntru_hrss701_ecdh_nistp384_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntru_hrss701); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * NTRU_HPS4096821_ECDH_NISTP521 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_ntru_hps4096821_ecdh_nistp521_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntru_hps4096821); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_ntru_hps4096821_ecdh_nistp521_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_ntru_hps4096821); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_ntru_hps4096821_ecdh_nistp521_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntru_hps4096821); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * CLASSIC_MCELIECE_348864_ECDH_NISTP256 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_classic_mceliece_348864_ecdh_nistp256_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_348864); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_classic_mceliece_348864_ecdh_nistp256_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_classic_mceliece_348864); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_classic_mceliece_348864_ecdh_nistp256_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_348864); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * CLASSIC_MCELIECE_348864F_ECDH_NISTP256 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_classic_mceliece_348864f_ecdh_nistp256_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_348864f); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_classic_mceliece_348864f_ecdh_nistp256_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_classic_mceliece_348864f); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_classic_mceliece_348864f_ecdh_nistp256_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_348864f); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * CLASSIC_MCELIECE_460896_ECDH_NISTP384 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_classic_mceliece_460896_ecdh_nistp384_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_460896); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_classic_mceliece_460896_ecdh_nistp384_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_classic_mceliece_460896); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_classic_mceliece_460896_ecdh_nistp384_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_460896); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * CLASSIC_MCELIECE_460896F_ECDH_NISTP384 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_classic_mceliece_460896f_ecdh_nistp384_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_460896f); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_classic_mceliece_460896f_ecdh_nistp384_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_classic_mceliece_460896f); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_classic_mceliece_460896f_ecdh_nistp384_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_460896f); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * CLASSIC_MCELIECE_6688128_ECDH_NISTP521 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_classic_mceliece_6688128_ecdh_nistp521_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_6688128); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_classic_mceliece_6688128_ecdh_nistp521_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_classic_mceliece_6688128); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_classic_mceliece_6688128_ecdh_nistp521_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_6688128); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * CLASSIC_MCELIECE_6688128F_ECDH_NISTP521 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_classic_mceliece_6688128f_ecdh_nistp521_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_6688128f); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_classic_mceliece_6688128f_ecdh_nistp521_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_classic_mceliece_6688128f); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_classic_mceliece_6688128f_ecdh_nistp521_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_6688128f); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * CLASSIC_MCELIECE_6960119_ECDH_NISTP521 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_classic_mceliece_6960119_ecdh_nistp521_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_6960119); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_classic_mceliece_6960119_ecdh_nistp521_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_classic_mceliece_6960119); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_classic_mceliece_6960119_ecdh_nistp521_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_6960119); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * CLASSIC_MCELIECE_6960119F_ECDH_NISTP521 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_classic_mceliece_6960119f_ecdh_nistp521_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_6960119f); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_classic_mceliece_6960119f_ecdh_nistp521_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_classic_mceliece_6960119f); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_classic_mceliece_6960119f_ecdh_nistp521_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_6960119f); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * CLASSIC_MCELIECE_8192128_ECDH_NISTP521 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_classic_mceliece_8192128_ecdh_nistp521_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_8192128); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_classic_mceliece_8192128_ecdh_nistp521_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_classic_mceliece_8192128); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_classic_mceliece_8192128_ecdh_nistp521_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_8192128); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * CLASSIC_MCELIECE_8192128F_ECDH_NISTP521 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_classic_mceliece_8192128f_ecdh_nistp521_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_8192128f); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_classic_mceliece_8192128f_ecdh_nistp521_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_classic_mceliece_8192128f); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_classic_mceliece_8192128f_ecdh_nistp521_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_classic_mceliece_8192128f); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * HQC_128_ECDH_NISTP256 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_hqc_128_ecdh_nistp256_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_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_hqc_128_ecdh_nistp256_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_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_hqc_128_ecdh_nistp256_dec(struct kex *kex, + const 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_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * HQC_192_ECDH_NISTP384 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_hqc_192_ecdh_nistp384_keypair(struct kex *kex) { - OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sike_p434); + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_hqc_192); if (kem == NULL) { return SSH_ERR_ALLOC_FAIL; } @@ -532,12 +2295,12 @@ int kex_kem_sike_p434_ecdh_nistp256_keypair(struct kex *kex) return r; } -int kex_kem_sike_p434_ecdh_nistp256_enc(struct kex *kex, +int kex_kem_hqc_192_ecdh_nistp384_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_sike_p434); + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_hqc_192); if (kem == NULL) { return SSH_ERR_ALLOC_FAIL; } @@ -546,11 +2309,298 @@ int kex_kem_sike_p434_ecdh_nistp256_enc(struct kex *kex, return r; } -int kex_kem_sike_p434_ecdh_nistp256_dec(struct kex *kex, +int kex_kem_hqc_192_ecdh_nistp384_dec(struct kex *kex, const struct sshbuf *server_blobp, struct sshbuf **shared_secretp) { - OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_sike_p434); + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_hqc_192); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * HQC_256_ECDH_NISTP521 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_hqc_256_ecdh_nistp521_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_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_hqc_256_ecdh_nistp521_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_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_hqc_256_ecdh_nistp521_dec(struct kex *kex, + const 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_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * NTRUPRIME_NTRULPR653_ECDH_NISTP256 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_ntruprime_ntrulpr653_ecdh_nistp256_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntruprime_ntrulpr653); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_ntruprime_ntrulpr653_ecdh_nistp256_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_ntruprime_ntrulpr653); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_ntruprime_ntrulpr653_ecdh_nistp256_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntruprime_ntrulpr653); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * NTRUPRIME_SNTRUP653_ECDH_NISTP256 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_ntruprime_sntrup653_ecdh_nistp256_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntruprime_sntrup653); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_ntruprime_sntrup653_ecdh_nistp256_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_ntruprime_sntrup653); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_ntruprime_sntrup653_ecdh_nistp256_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntruprime_sntrup653); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * NTRUPRIME_NTRULPR761_ECDH_NISTP384 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_ntruprime_ntrulpr761_ecdh_nistp384_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntruprime_ntrulpr761); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_ntruprime_ntrulpr761_ecdh_nistp384_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_ntruprime_ntrulpr761); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_ntruprime_ntrulpr761_ecdh_nistp384_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntruprime_ntrulpr761); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * NTRUPRIME_SNTRUP761_ECDH_NISTP384 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_ntruprime_sntrup761_ecdh_nistp384_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntruprime_sntrup761); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_ntruprime_sntrup761_ecdh_nistp384_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_ntruprime_sntrup761); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_ntruprime_sntrup761_ecdh_nistp384_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntruprime_sntrup761); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * NTRUPRIME_NTRULPR857_ECDH_NISTP384 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_ntruprime_ntrulpr857_ecdh_nistp384_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntruprime_ntrulpr857); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_ntruprime_ntrulpr857_ecdh_nistp384_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_ntruprime_ntrulpr857); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_ntruprime_ntrulpr857_ecdh_nistp384_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntruprime_ntrulpr857); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_dec(kem, kex, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} +/*--------------------------------------------------------------- + * NTRUPRIME_SNTRUP857_ECDH_NISTP384 METHODS + *--------------------------------------------------------------- + */ +int kex_kem_ntruprime_sntrup857_ecdh_nistp384_keypair(struct kex *kex) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntruprime_sntrup857); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_keypair(kem, kex); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_ntruprime_sntrup857_ecdh_nistp384_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_ntruprime_sntrup857); + if (kem == NULL) { + return SSH_ERR_ALLOC_FAIL; + } + int r = kex_kem_generic_with_ec_enc(kem, kex, client_blob, server_blobp, shared_secretp); + OQS_KEM_free(kem); + return r; +} + +int kex_kem_ntruprime_sntrup857_ecdh_nistp384_dec(struct kex *kex, + const struct sshbuf *server_blobp, + struct sshbuf **shared_secretp) +{ + OQS_KEM *kem = OQS_KEM_new(OQS_KEM_alg_ntruprime_sntrup857); if (kem == NULL) { return SSH_ERR_ALLOC_FAIL; } diff --git a/match.c b/match.c index 927565c188c6..1089e8143428 100644 --- a/match.c +++ b/match.c @@ -265,7 +265,7 @@ match_user(const char *user, const char *host, const char *ipaddr, * Returns first item from client-list that is also supported by server-list, * caller must free the returned string. */ -#define MAX_PROP 40 +#define MAX_PROP 60 #define SEP "," char * match_list(const char *client, const char *server, u_int *next) diff --git a/monitor.c b/monitor.c index 9736ebdbaa4f..23a1f602cddc 100644 --- a/monitor.c +++ b/monitor.c @@ -1734,14 +1734,114 @@ monitor_apply_keystate(struct ssh *ssh, struct monitor *pmonitor) kex->kex[KEX_KEM_FRODOKEM_640_AES_SHA256] = kex_gen_server; kex->kex[KEX_KEM_FRODOKEM_976_AES_SHA384] = kex_gen_server; kex->kex[KEX_KEM_FRODOKEM_1344_AES_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_FRODOKEM_640_SHAKE_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_FRODOKEM_976_SHAKE_SHA384] = kex_gen_server; + kex->kex[KEX_KEM_FRODOKEM_1344_SHAKE_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_SIDH_P434_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_SIDH_P434_COMPRESSED_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_SIDH_P610_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_SIDH_P610_COMPRESSED_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_SIDH_P751_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_SIDH_P751_COMPRESSED_SHA256] = kex_gen_server; kex->kex[KEX_KEM_SIKE_P434_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_SIKE_P434_COMPRESSED_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_SIKE_P610_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_SIKE_P610_COMPRESSED_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_SIKE_P751_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_SIKE_P751_COMPRESSED_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_SABER_LIGHTSABER_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_SABER_SABER_SHA384] = kex_gen_server; + kex->kex[KEX_KEM_SABER_FIRESABER_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_KYBER_512_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_KYBER_768_SHA384] = kex_gen_server; + kex->kex[KEX_KEM_KYBER_1024_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_KYBER_512_90S_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_KYBER_768_90S_SHA384] = kex_gen_server; + kex->kex[KEX_KEM_KYBER_1024_90S_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_BIKE1_L1_CPA_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_BIKE1_L1_FO_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_BIKE1_L3_CPA_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_BIKE1_L3_FO_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_NTRU_HPS2048509_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_NTRU_HPS2048677_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_NTRU_HRSS701_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_NTRU_HPS4096821_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_CLASSIC_MCELIECE_348864_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_CLASSIC_MCELIECE_348864F_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_CLASSIC_MCELIECE_460896_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_CLASSIC_MCELIECE_460896F_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_CLASSIC_MCELIECE_6688128_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_CLASSIC_MCELIECE_6688128F_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_CLASSIC_MCELIECE_6960119_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_CLASSIC_MCELIECE_6960119F_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_CLASSIC_MCELIECE_8192128_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_CLASSIC_MCELIECE_8192128F_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_HQC_128_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_HQC_192_SHA384] = kex_gen_server; + kex->kex[KEX_KEM_HQC_256_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_NTRUPRIME_NTRULPR653_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_NTRUPRIME_SNTRUP653_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_NTRUPRIME_NTRULPR761_SHA384] = kex_gen_server; + kex->kex[KEX_KEM_NTRUPRIME_SNTRUP761_SHA384] = kex_gen_server; + kex->kex[KEX_KEM_NTRUPRIME_NTRULPR857_SHA384] = kex_gen_server; + kex->kex[KEX_KEM_NTRUPRIME_SNTRUP857_SHA384] = kex_gen_server; #ifdef WITH_OPENSSL #ifdef OPENSSL_HAS_ECC kex->kex[KEX_KEM_OQS_DEFAULT_ECDH_NISTP256_SHA256] = kex_gen_server; kex->kex[KEX_KEM_FRODOKEM_640_AES_ECDH_NISTP256_SHA256] = kex_gen_server; kex->kex[KEX_KEM_FRODOKEM_976_AES_ECDH_NISTP384_SHA384] = kex_gen_server; kex->kex[KEX_KEM_FRODOKEM_1344_AES_ECDH_NISTP521_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_FRODOKEM_640_SHAKE_ECDH_NISTP256_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_FRODOKEM_976_SHAKE_ECDH_NISTP384_SHA384] = kex_gen_server; + kex->kex[KEX_KEM_FRODOKEM_1344_SHAKE_ECDH_NISTP521_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_SIDH_P434_ECDH_NISTP256_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_SIDH_P434_COMPRESSED_ECDH_NISTP256_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_SIDH_P610_ECDH_NISTP384_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_SIDH_P610_COMPRESSED_ECDH_NISTP384_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_SIDH_P751_ECDH_NISTP521_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_SIDH_P751_COMPRESSED_ECDH_NISTP521_SHA256] = kex_gen_server; kex->kex[KEX_KEM_SIKE_P434_ECDH_NISTP256_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_SIKE_P434_COMPRESSED_ECDH_NISTP256_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_SIKE_P610_ECDH_NISTP384_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_SIKE_P610_COMPRESSED_ECDH_NISTP384_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_SIKE_P751_ECDH_NISTP521_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_SIKE_P751_COMPRESSED_ECDH_NISTP521_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_SABER_LIGHTSABER_ECDH_NISTP256_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_SABER_SABER_ECDH_NISTP384_SHA384] = kex_gen_server; + kex->kex[KEX_KEM_SABER_FIRESABER_ECDH_NISTP521_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_KYBER_512_ECDH_NISTP256_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_KYBER_768_ECDH_NISTP384_SHA384] = kex_gen_server; + kex->kex[KEX_KEM_KYBER_1024_ECDH_NISTP521_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_KYBER_512_90S_ECDH_NISTP256_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_KYBER_768_90S_ECDH_NISTP384_SHA384] = kex_gen_server; + kex->kex[KEX_KEM_KYBER_1024_90S_ECDH_NISTP521_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_BIKE1_L1_CPA_ECDH_NISTP256_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_BIKE1_L1_FO_ECDH_NISTP256_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_BIKE1_L3_CPA_ECDH_NISTP384_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_BIKE1_L3_FO_ECDH_NISTP384_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_NTRU_HPS2048509_ECDH_NISTP256_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_NTRU_HPS2048677_ECDH_NISTP384_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_NTRU_HRSS701_ECDH_NISTP384_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_NTRU_HPS4096821_ECDH_NISTP521_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_CLASSIC_MCELIECE_348864_ECDH_NISTP256_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_CLASSIC_MCELIECE_348864F_ECDH_NISTP256_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_CLASSIC_MCELIECE_460896_ECDH_NISTP384_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_CLASSIC_MCELIECE_460896F_ECDH_NISTP384_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_CLASSIC_MCELIECE_6688128_ECDH_NISTP521_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_CLASSIC_MCELIECE_6688128F_ECDH_NISTP521_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_CLASSIC_MCELIECE_6960119_ECDH_NISTP521_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_CLASSIC_MCELIECE_6960119F_ECDH_NISTP521_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_CLASSIC_MCELIECE_8192128_ECDH_NISTP521_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_CLASSIC_MCELIECE_8192128F_ECDH_NISTP521_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_HQC_128_ECDH_NISTP256_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_HQC_192_ECDH_NISTP384_SHA384] = kex_gen_server; + kex->kex[KEX_KEM_HQC_256_ECDH_NISTP521_SHA512] = kex_gen_server; + kex->kex[KEX_KEM_NTRUPRIME_NTRULPR653_ECDH_NISTP256_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_NTRUPRIME_SNTRUP653_ECDH_NISTP256_SHA256] = kex_gen_server; + kex->kex[KEX_KEM_NTRUPRIME_NTRULPR761_ECDH_NISTP384_SHA384] = kex_gen_server; + kex->kex[KEX_KEM_NTRUPRIME_SNTRUP761_ECDH_NISTP384_SHA384] = kex_gen_server; + kex->kex[KEX_KEM_NTRUPRIME_NTRULPR857_ECDH_NISTP384_SHA384] = kex_gen_server; + kex->kex[KEX_KEM_NTRUPRIME_SNTRUP857_ECDH_NISTP384_SHA384] = kex_gen_server; #endif /* OPENSSL_HAS_ECC */ #endif /* WITH_OPENSSL */ ///// OQS_TEMPLATE_FRAGMENT_APPLY_KEYSTATE_END diff --git a/myproposal.h b/myproposal.h index 492655f154e0..36b3824cc047 100644 --- a/myproposal.h +++ b/myproposal.h @@ -46,8 +46,108 @@ "ecdh-nistp384-frodokem-976-aes-sha384," \ "frodokem-1344-aes-sha512," \ "ecdh-nistp521-frodokem-1344-aes-sha512," \ + "frodokem-640-shake-sha256," \ + "ecdh-nistp256-frodokem-640-shake-sha256," \ + "frodokem-976-shake-sha384," \ + "ecdh-nistp384-frodokem-976-shake-sha384," \ + "frodokem-1344-shake-sha512," \ + "ecdh-nistp521-frodokem-1344-shake-sha512," \ + "sidh-p434-sha256," \ + "ecdh-nistp256-sidh-p434-sha256," \ + "sidh-p434-compressed-sha256," \ + "ecdh-nistp256-sidh-p434-compressed-sha256," \ + "sidh-p610-sha256," \ + "ecdh-nistp384-sidh-p610-sha256," \ + "sidh-p610-compressed-sha256," \ + "ecdh-nistp384-sidh-p610-compressed-sha256," \ + "sidh-p751-sha256," \ + "ecdh-nistp521-sidh-p751-sha256," \ + "sidh-p751-compressed-sha256," \ + "ecdh-nistp521-sidh-p751-compressed-sha256," \ "sike-p434-sha256," \ - "ecdh-nistp256-sike-p434-sha256" + "ecdh-nistp256-sike-p434-sha256," \ + "sike-p434-compressed-sha256," \ + "ecdh-nistp256-sike-p434-compressed-sha256," \ + "sike-p610-sha256," \ + "ecdh-nistp384-sike-p610-sha256," \ + "sike-p610-compressed-sha256," \ + "ecdh-nistp384-sike-p610-compressed-sha256," \ + "sike-p751-sha256," \ + "ecdh-nistp521-sike-p751-sha256," \ + "sike-p751-compressed-sha256," \ + "ecdh-nistp521-sike-p751-compressed-sha256," \ + "saber-lightsaber-sha256," \ + "ecdh-nistp256-saber-lightsaber-sha256," \ + "saber-saber-sha384," \ + "ecdh-nistp384-saber-saber-sha384," \ + "saber-firesaber-sha512," \ + "ecdh-nistp521-saber-firesaber-sha512," \ + "kyber-512-sha256," \ + "ecdh-nistp256-kyber-512-sha256," \ + "kyber-768-sha384," \ + "ecdh-nistp384-kyber-768-sha384," \ + "kyber-1024-sha512," \ + "ecdh-nistp521-kyber-1024-sha512," \ + "kyber-512-90s-sha256," \ + "ecdh-nistp256-kyber-512-90s-sha256," \ + "kyber-768-90s-sha384," \ + "ecdh-nistp384-kyber-768-90s-sha384," \ + "kyber-1024-90s-sha512," \ + "ecdh-nistp521-kyber-1024-90s-sha512," \ + "bike1-l1-cpa-sha512," \ + "ecdh-nistp256-bike1-l1-cpa-sha512," \ + "bike1-l1-fo-sha512," \ + "ecdh-nistp256-bike1-l1-fo-sha512," \ + "bike1-l3-cpa-sha512," \ + "ecdh-nistp384-bike1-l3-cpa-sha512," \ + "bike1-l3-fo-sha512," \ + "ecdh-nistp384-bike1-l3-fo-sha512," \ + "ntru-hps2048509-sha512," \ + "ecdh-nistp256-ntru-hps2048509-sha512," \ + "ntru-hps2048677-sha512," \ + "ecdh-nistp384-ntru-hps2048677-sha512," \ + "ntru-hrss701-sha512," \ + "ecdh-nistp384-ntru-hrss701-sha512," \ + "ntru-hps4096821-sha512," \ + "ecdh-nistp521-ntru-hps4096821-sha512," \ + "classic-mceliece-348864-sha256," \ + "ecdh-nistp256-classic-mceliece-348864-sha256," \ + "classic-mceliece-348864f-sha256," \ + "ecdh-nistp256-classic-mceliece-348864f-sha256," \ + "classic-mceliece-460896-sha512," \ + "ecdh-nistp384-classic-mceliece-460896-sha512," \ + "classic-mceliece-460896f-sha512," \ + "ecdh-nistp384-classic-mceliece-460896f-sha512," \ + "classic-mceliece-6688128-sha512," \ + "ecdh-nistp521-classic-mceliece-6688128-sha512," \ + "classic-mceliece-6688128f-sha512," \ + "ecdh-nistp521-classic-mceliece-6688128f-sha512," \ + "classic-mceliece-6960119-sha512," \ + "ecdh-nistp521-classic-mceliece-6960119-sha512," \ + "classic-mceliece-6960119f-sha512," \ + "ecdh-nistp521-classic-mceliece-6960119f-sha512," \ + "classic-mceliece-8192128-sha512," \ + "ecdh-nistp521-classic-mceliece-8192128-sha512," \ + "classic-mceliece-8192128f-sha512," \ + "ecdh-nistp521-classic-mceliece-8192128f-sha512," \ + "hqc-128-sha256," \ + "ecdh-nistp256-hqc-128-sha256," \ + "hqc-192-sha384," \ + "ecdh-nistp384-hqc-192-sha384," \ + "hqc-256-sha512," \ + "ecdh-nistp521-hqc-256-sha512," \ + "ntruprime-ntrulpr653-sha256," \ + "ecdh-nistp256-ntruprime-ntrulpr653-sha256," \ + "ntruprime-sntrup653-sha256," \ + "ecdh-nistp256-ntruprime-sntrup653-sha256," \ + "ntruprime-ntrulpr761-sha384," \ + "ecdh-nistp384-ntruprime-ntrulpr761-sha384," \ + "ntruprime-sntrup761-sha384," \ + "ecdh-nistp384-ntruprime-sntrup761-sha384," \ + "ntruprime-ntrulpr857-sha384," \ + "ecdh-nistp384-ntruprime-ntrulpr857-sha384," \ + "ntruprime-sntrup857-sha384," \ + "ecdh-nistp384-ntruprime-sntrup857-sha384" /*/// OQS_TEMPLATE_FRAGMENT_ADD_SERVER_KEXS_END */ #define KEX_CLIENT_KEX KEX_SERVER_KEX diff --git a/oqs-template/README.md/list_all_kexs.fragment b/oqs-template/README.md/list_all_kexs.fragment index f966c8bf8c33..d768010b6558 100644 --- a/oqs-template/README.md/list_all_kexs.fragment +++ b/oqs-template/README.md/list_all_kexs.fragment @@ -1,4 +1,4 @@ {%- for family, kexs in (config['kexs'] | selectattr("family") | groupby('family')) %} -- **{{ family }}**: {% for kex in kexs -%} `{{ kex['name']|replace('_','-') }}-{{ kex['hash'] }}` {%- if not loop.last %}, {% endif -%}{%- if loop.last and family == 'HQC' -%}†{%- endif -%}{%- endfor -%} +- **{{ family }}**: {% for kex in kexs -%} `{{ kex['name']|replace('_','-') }}-{{ kex['hash'] }}` {%- if kex['enable'] -%} * {%- endif -%} {%- if not loop.last %}, {% endif -%}{%- if loop.last and family == 'HQC' -%}†{%- endif -%}{%- endfor -%} {%- endfor %} diff --git a/oqs-template/README.md/list_all_sigs.fragment b/oqs-template/README.md/list_all_sigs.fragment index 6e34611c2fb8..af6de1a1ded4 100644 --- a/oqs-template/README.md/list_all_sigs.fragment +++ b/oqs-template/README.md/list_all_sigs.fragment @@ -1,4 +1,4 @@ {%- for family, sigs in (config['sigs'] | selectattr('family') | groupby('family')) %} -- **{{ family }}**: {% for sig in sigs -%} `{{ sig['name']|replace('_','') }}` {%- if not loop.last %}, {% endif -%} {%- endfor -%} +- **{{ family }}**: {% for sig in sigs -%} `{{ sig['name']|replace('_','') }}` {%- if sig['enable'] -%} * {%- endif -%} {%- if not loop.last %}, {% endif -%} {%- endfor -%} {%- endfor %} diff --git a/oqs-template/generate.py b/oqs-template/generate.py index 2d0f3a889de4..027b41ee9b9b 100644 --- a/oqs-template/generate.py +++ b/oqs-template/generate.py @@ -46,9 +46,15 @@ def populate(filename, config, delimiter): file_put_contents(filename, contents) -def load_config(): +def load_config(include_disabled_algs=False): config = file_get_contents(os.path.join('oqs-template', 'generate.yml'), encoding='utf-8') config = yaml.safe_load(config) + if not include_disabled_algs: + config['sigs'] = [sig for sig in config['sigs'] if 'enable' in sig.keys() and sig['enable']] + + # enable if single KEXs are to be en/disabled: + #config['kexs'] = [kex for kex in config['kexs'] if 'enable' in kex.keys() and kex['enable']] + return config config = load_config() @@ -84,5 +90,8 @@ def load_config(): # both populate('ssh-keyscan.c', config, '/////') -populate('README.md', config, '