-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Simon Josefsson <[email protected]>
- Loading branch information
Showing
17 changed files
with
348 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -942,4 +942,10 @@ struct winsize { | |
#if defined(VARIABLE_LENGTH_ARRAYS) && defined(VARIABLE_DECLARATION_AFTER_CODE) | ||
# define USE_SNTRUP761X25519 1 | ||
#endif | ||
|
||
/* Enable [email protected] if we have libmceliece. */ | ||
#ifdef USE_LIBMCELIECE | ||
# define USE_MCELIECE6688128X25519 1 | ||
#endif | ||
|
||
#endif /* _DEFINES_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,6 +63,7 @@ | |
#define KEX_CURVE25519_SHA256 "curve25519-sha256" | ||
#define KEX_CURVE25519_SHA256_OLD "[email protected]" | ||
#define KEX_SNTRUP761X25519_SHA512 "[email protected]" | ||
#define KEX_MCELIECE6688128X25519_SHA512 "[email protected]" | ||
|
||
#define COMP_NONE 0 | ||
/* pre-auth compression (COMP_ZLIB) is only supported in the client */ | ||
|
@@ -102,6 +103,7 @@ enum kex_exchange { | |
KEX_ECDH_SHA2, | ||
KEX_C25519_SHA256, | ||
KEX_KEM_SNTRUP761X25519_SHA512, | ||
KEX_KEM_MCELIECE6688128X25519_SHA512, | ||
KEX_MAX | ||
}; | ||
|
||
|
@@ -180,6 +182,9 @@ struct kex { | |
u_char c25519_client_key[CURVE25519_SIZE]; /* 25519 + KEM */ | ||
u_char c25519_client_pubkey[CURVE25519_SIZE]; /* 25519 */ | ||
u_char sntrup761_client_key[crypto_kem_sntrup761_SECRETKEYBYTES]; /* KEM */ | ||
#ifdef USE_MCELIECE6688128X25519 | ||
u_char mceliece6688128_client_key[crypto_kem_mceliece6688128_SECRETKEYBYTES]; /* KEM */ | ||
#endif | ||
struct sshbuf *client_pub; | ||
}; | ||
|
||
|
@@ -241,6 +246,12 @@ int kex_kem_sntrup761x25519_enc(struct kex *, const struct sshbuf *, | |
int kex_kem_sntrup761x25519_dec(struct kex *, const struct sshbuf *, | ||
struct sshbuf **); | ||
|
||
int kex_kem_mceliece6688128x25519_keypair(struct kex *); | ||
int kex_kem_mceliece6688128x25519_enc(struct kex *, const struct sshbuf *, | ||
struct sshbuf **, struct sshbuf **); | ||
int kex_kem_mceliece6688128x25519_dec(struct kex *, const struct sshbuf *, | ||
struct sshbuf **); | ||
|
||
int kex_dh_keygen(struct kex *); | ||
int kex_dh_compute_key(struct kex *, BIGNUM *, struct sshbuf *); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.