diff options
author | Werner Koch <wk@gnupg.org> | 2013-09-07 10:06:46 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2013-09-25 10:08:57 +0200 |
commit | 64a7d347847d606eb5f4c156e24ba060271b8f6b (patch) | |
tree | 63735c97112206ed17a2e8823b60df4749794109 /src/ec-context.h | |
parent | 1f5f4452e5bca105ec2197a4facbf9778e7dc31e (diff) | |
download | libgcrypt-64a7d347847d606eb5f4c156e24ba060271b8f6b.tar.gz |
ecc: Refactor low-level access functions.
* mpi/ec.c (point_copy): Move to cipher/ecc-curves.c.
(ec_get_reset): Rename to _gcry_mpi_ec_get_reset and make global.
(_gcry_mpi_ec_get_mpi): Factor most code out to _gcry_ecc_get_mpi.
(_gcry_mpi_ec_get_point): Factor most code out to _gcry_ecc_get_point.
(_gcry_mpi_ec_set_mpi): Factor most code out to _gcry_ecc_set_mpi.
(_gcry_mpi_ec_set_point): Factor most code out to _gcry_ecc_set_point.
* cipher/ecc-curves.c (_gcry_ecc_get_mpi): New.
(_gcry_ecc_get_point, _gcry_ecc_set_mpi, _gcry_ecc_set_point): New.
* cipher/ecc-misc.c (_gcry_ecc_compute_public): New.
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'src/ec-context.h')
-rw-r--r-- | src/ec-context.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/ec-context.h b/src/ec-context.h index f2ad19b4..fdfbc0a3 100644 --- a/src/ec-context.h +++ b/src/ec-context.h @@ -62,5 +62,20 @@ struct mpi_ec_ctx_s }; +/*-- mpi/ec.c --*/ +void _gcry_mpi_ec_get_reset (mpi_ec_t ec); + + +/*-- cipher/ecc-curves.c --*/ +gpg_err_code_t _gcry_mpi_ec_new (gcry_ctx_t *r_ctx, + gcry_sexp_t keyparam, const char *curvename); + +gcry_mpi_t _gcry_ecc_get_mpi (const char *name, mpi_ec_t ec, int copy); +gcry_mpi_point_t _gcry_ecc_get_point (const char *name, mpi_ec_t ec); +gpg_err_code_t _gcry_ecc_set_mpi (const char *name, + gcry_mpi_t newvalue, mpi_ec_t ec); +gpg_err_code_t _gcry_ecc_set_point (const char *name, + gcry_mpi_point_t newvalue, mpi_ec_t ec); + #endif /*GCRY_EC_CONTEXT_H*/ |