diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2015-08-06 17:31:41 +0900 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2015-08-06 17:31:41 +0900 |
commit | e93f4c21c59756604440ad8cbf27e67d29c99ffd (patch) | |
tree | 4b97f8a1f8d8804f6897c3afb21527897eda04e6 /tests/curves.c | |
parent | b4b1d872ba651bc44761b35d245b1a519a33f515 (diff) | |
download | libgcrypt-e93f4c21c59756604440ad8cbf27e67d29c99ffd.tar.gz |
Add Curve25519 support.
* cipher/ecc-curves.c (curve_aliases, domain_parms): Add Curve25519.
* tests/curves.c (N_CURVES): It's 22 now.
* src/cipher.h (PUBKEY_FLAG_DJB_TWEAK): New.
* cipher/ecc-common.h (_gcry_ecc_mont_decodepoint): New.
* cipher/ecc-misc.c (_gcry_ecc_mont_decodepoint): New.
* cipher/ecc.c (nist_generate_key): Handle the case of
PUBKEY_FLAG_DJB_TWEAK and Montgomery curve.
(test_ecdh_only_keys, check_secret_key): Likewise.
(ecc_generate): Support Curve25519 which is Montgomery curve with flag
PUBKEY_FLAG_DJB_TWEAK and PUBKEY_FLAG_COMP.
(ecc_encrypt_raw): Get flags from KEYPARMS and handle
PUBKEY_FLAG_DJB_TWEAK and Montgomery curve.
(ecc_decrypt_raw): Likewise.
(compute_keygrip): Handle the case of PUBKEY_FLAG_DJB_TWEAK.
* cipher/pubkey-util.c (_gcry_pk_util_parse_flaglist):
PUBKEY_FLAG_EDDSA implies PUBKEY_FLAG_DJB_TWEAK.
Parse "djb-tweak" for PUBKEY_FLAG_DJB_TWEAK.
--
With PUBKEY_FLAG_DJB_TWEAK, secret key has msb set and it should be
always multiple by cofactor.
Diffstat (limited to 'tests/curves.c')
-rw-r--r-- | tests/curves.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/curves.c b/tests/curves.c index 178a1922..bec48e99 100644 --- a/tests/curves.c +++ b/tests/curves.c @@ -29,7 +29,7 @@ #include "../src/gcrypt-int.h" /* Number of curves defined in ../cipger/ecc.c */ -#define N_CURVES 21 +#define N_CURVES 22 /* A real world sample public key. */ static char const sample_key_1[] = |