Zero an mpz_t?
james at jamesbb.co.uk
Mon Dec 19 01:11:44 CET 2011
Thanks for your replies.
I have requirements to zero cryptographic 'secrets' represented by mpz_t types. I'll have a look through the internal functions and see if I can access the memory from there.
On 18 Dec 2011, at 23:53, Christ Schlacta <aarcane at gmail.com> wrote:
> On 12/18/2011 12:56, Marc Glisse wrote:
>> On Sun, 18 Dec 2011, james at jamesbb.co.uk wrote:
>>> Is there a way to 'zero' an mpz_t integer, such that all of the bytes used to
>>> store the number are overwritten?
>>> I'm assuming that assigning the value of 0 will not do this, but I might be
>> obviously, you can do it by hand (see http://gmplib.org/manual/Integer-Internals.html), but gmp doesn't provide an interface to do that because there is no (arithmetic) reason to do such a thing.
>> It is hard to give better advice without knowing what your exact goal is.
> I'd like to request an interface to do exactly what the OP requested, AND/OR to trim the internals to minimum storage requirements. The reasons are purely application design time. Seems as fine a time as any, also, to re-request a compact, stable, binary import/export format as well for on disk storage.
> gmp-discuss mailing list
> gmp-discuss at gmplib.org
More information about the gmp-discuss