summaryrefslogtreecommitdiff
path: root/src
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 /src
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 'src')
-rw-r--r--src/ec-context.h2
-rw-r--r--src/mpi.h2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/ec-context.h b/src/ec-context.h
index a118608e..60ca7590 100644
--- a/src/ec-context.h
+++ b/src/ec-context.h
@@ -27,6 +27,8 @@ struct mpi_ec_ctx_s
enum ecc_dialects dialect; /* The ECC dialect used with the curve. */
+ int flags; /* Public key flags (not always used). */
+
unsigned int nbits; /* Number of bits. */
/* Domain parameters. Note that they may not all be set and if set
diff --git a/src/mpi.h b/src/mpi.h
index 15fb5423..a5d805e3 100644
--- a/src/mpi.h
+++ b/src/mpi.h
@@ -312,10 +312,12 @@ void _gcry_mpi_point_log (const char *name, mpi_point_t point, mpi_ec_t ctx);
mpi_ec_t _gcry_mpi_ec_p_internal_new (enum gcry_mpi_ec_models model,
enum ecc_dialects dialect,
+ int flags,
gcry_mpi_t p, gcry_mpi_t a, gcry_mpi_t b);
gpg_err_code_t _gcry_mpi_ec_p_new (gcry_ctx_t *r_ctx,
enum gcry_mpi_ec_models model,
enum ecc_dialects dialect,
+ int flags,
gcry_mpi_t p, gcry_mpi_t a, gcry_mpi_t b);
void _gcry_mpi_ec_free (mpi_ec_t ctx);