-
Notifications
You must be signed in to change notification settings - Fork 478
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
Add clamp
function to Scalar
struct
#498
Add clamp
function to Scalar
struct
#498
Conversation
clamp
function to Scalar
struct (#497)clamp
function to Scalar
struct
Just as a general impression: you're making a lot of superfluous copies of secret key material. IMO when dealing with key material you should try to make as few copies as possible. LLVM will most likely optimize them all away, but it would be better if you wrote the code in such a way it didn't make copies in the first place. |
FWIW, this is a great writeup on clamping: https://www.reddit.com/r/crypto/comments/107i1ar/why_do_we_need_to_clamp_25519_keys_when_we/j3nj8y5/ |
Scalar::from_bytes
to removemut Scalar
variable (I think this way it's a bit more clean)