diff options
author | Werner Koch <wk@gnupg.org> | 2013-03-13 15:08:33 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2013-03-13 15:08:33 +0100 |
commit | e005629bd7bebb3e13945645c6e1230b44ab16a2 (patch) | |
tree | 46dc8a478d794e103ee4e70ec5c0832902d1bcba /NEWS | |
parent | 1fecae98ee7e0fa49b29f98efa6817ca121ed98a (diff) | |
download | libgcrypt-e005629bd7bebb3e13945645c6e1230b44ab16a2.tar.gz |
Add GCRYMPI_FLAG_CONST and make use constants.
* src/gcrypt.h.in (GCRYMPI_FLAG_CONST): New.
* src/mpi.h (mpi_is_const, mpi_const): New.
(enum gcry_mpi_constants, MPI_NUMBER_OF_CONSTANTS): New.
* mpi/mpiutil.c (_gcry_mpi_init): New.
(constants): New.
(_gcry_mpi_free): Do not release a constant flagged MPI.
(gcry_mpi_copy): Clear the const and immutable flags.
(gcry_mpi_set_flag, gcry_mpi_clear_flag, gcry_mpi_get_flag): Support
GCRYMPI_FLAG_CONST.
(_gcry_mpi_const): New.
* src/global.c (global_init): Call _gcry_mpi_init.
* mpi/ec.c (mpi_ec_ctx_s): Remove fields one, two, three, four, and
eight. Change all users to call mpi_const() instead.
* src/mpiutils.c (gcry_mpi_set_opaque): Check the immutable flag.
--
Allocating the trivial constants newly for every EC context is a waste
of memory and cpu cycles. We instead provide a simple mechanism to
internally support such constants. Using a new flag in THE API also
allows to mark an arbitrary MPI as constant. The drawback of the
constants is the their memory will never be deallocated. However,
that is what constants are about.
Diffstat (limited to 'NEWS')
-rw-r--r-- | NEWS | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -51,6 +51,7 @@ Noteworthy changes in version 1.6.0 (unreleased) gcry_mpi_ec_add NEW. gcry_mpi_ec_mul NEW. GCRYMPI_FLAG_IMMUTABLE NEW. + GCRYMPI_FLAG_CONST NEW. Noteworthy changes in version 1.5.0 (2011-06-29) |