Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved Zeroize impl for BigInt's Sign #39

Merged

Conversation

tarcieri
Copy link

@tarcieri tarcieri commented Mar 3, 2022

The zeroize crate defines a blanket impl of Zeroize for any type with the DefaultIsZeroes marker trait, which replaces the value with its Default using volatile writes with a memory fence.

This does require defining Default on Sign, but it seems like Sign::NoSign is a fairly reasonable choice for a default.

The `zeroize` crate defines a blanket impl of `Zeroize` for any type
with the `DefaultIsZeroes` marker trait, which replaces the value with
its `Default` using volatile writes with a memory fence.

This does require defining `Default` on `Sign`, but it seems like
`Sign::NoSign` is a fairly reasonable choice for a default.
Copy link
Owner

@dignifiedquire dignifiedquire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@dignifiedquire dignifiedquire merged commit f6b46ff into dignifiedquire:master Mar 3, 2022
@tarcieri tarcieri deleted the zeroize-sign-improvement branch March 3, 2022 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants