portable method to zeroize memory when destroying a mpz number
marc.glisse at inria.fr
Thu Mar 20 14:30:13 UTC 2014
On Thu, 20 Mar 2014, Vicente Benjumea wrote:
> when implementing public key cryptography algorithms, it would be nice
> to have a portable method to zeroize (reset to zero) the memory that
> holds the big-number bits before being destroyed, specially for private
I think there have been discussions about this on this list in the past.
> For example, something similar to:
> mpz_clear_zeroize (mpz_ptr m)
That doesn't cover all deallocations. When you write:
GMP may reallocate a so the result fits.
Best would be for you to use the existing GMP interfaces to replace the
allocation/deallocation functions and zero memory there.
More information about the gmp-discuss