You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FIPS 204, Section 3.6.3 demands the destruction of intermediate values
before returning to the caller. This commit implements this.
A new function mld_zeroize() is introduced which is used to wipe
intermediate stack buffers prior to function return. By default,
mld_zeroize() is implemented via SecureZeroMemory on Windows, and a
plain memset + compiler barrier otherwise. If neither makes sense,
compilation fails. Using memset_s would be preferred, but there is no
portable way of detecting whether it is available.
If users need to register a custom mld_zeroize, they can do so by
defining MLD_CONFIG_CUSTOM_ZEROIZE and defining mld_zeroize_native,
similar to how the arithmetic and FIPS-202 backends work. This includes
the case where the user does not wish to do stack zeroization, or has
an entirely separate (and more robust) method for it, such as compiler
instrumentation. In this case, mld_zeroize_native() can be set to a
no-op.
Signed-off-by: Jake Massimo <[email protected]>
0 commit comments