summaryrefslogtreecommitdiff
path: root/cipher/ecc-eddsa.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2013-11-05 17:25:02 +0100
committerWerner Koch <wk@gnupg.org>2013-11-05 17:26:52 +0100
commitf09ffe8a4802af65a116e79eceeb1cb4ed4fa2f4 (patch)
tree294ee667a0c27bd20c333eab4fb69bb04b8c8de3 /cipher/ecc-eddsa.c
parent630aca794ddf057fb7265b7dc346374743036af4 (diff)
downloadlibgcrypt-f09ffe8a4802af65a116e79eceeb1cb4ed4fa2f4.tar.gz
ecc: Fully implement Ed25519 compression in ECDSA mode.
* src/ec-context.h (mpi_ec_ctx_s): Add field FLAGS. * mpi/ec.c (ec_p_init): Add arg FLAGS. Change all callers to pass it. * cipher/ecc-curves.c (point_from_keyparam): Add arg EC, parse as opaque mpi and use eddsa decoding depending on the flag. (_gcry_mpi_ec_new): Rearrange to parse Q and D after knowing the curve. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'cipher/ecc-eddsa.c')
-rw-r--r--cipher/ecc-eddsa.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cipher/ecc-eddsa.c b/cipher/ecc-eddsa.c
index 22f27023..d83b7c69 100644
--- a/cipher/ecc-eddsa.c
+++ b/cipher/ecc-eddsa.c
@@ -441,7 +441,7 @@ _gcry_ecc_eddsa_sign (gcry_mpi_t input, ECC_secret_key *skey,
x = mpi_new (0);
y = mpi_new (0);
r = mpi_new (0);
- ctx = _gcry_mpi_ec_p_internal_new (skey->E.model, skey->E.dialect,
+ ctx = _gcry_mpi_ec_p_internal_new (skey->E.model, skey->E.dialect, 0,
skey->E.p, skey->E.a, skey->E.b);
b = (ctx->nbits+7)/8;
if (b != 256/8)
@@ -618,7 +618,7 @@ _gcry_ecc_eddsa_verify (gcry_mpi_t input, ECC_public_key *pkey,
h = mpi_new (0);
s = mpi_new (0);
- ctx = _gcry_mpi_ec_p_internal_new (pkey->E.model, pkey->E.dialect,
+ ctx = _gcry_mpi_ec_p_internal_new (pkey->E.model, pkey->E.dialect, 0,
pkey->E.p, pkey->E.a, pkey->E.b);
b = ctx->nbits/8;
if (b != 256/8)