-
Notifications
You must be signed in to change notification settings - Fork 127
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
dsa: migrate to crypto-bigint
#906
base: master
Are you sure you want to change the base?
Conversation
cc @aumetra |
Apologies, I was a bit absent lately. I'll have a look when I get the time (which should be in like two hours at max) |
No need to apologize! Please take care. If there are specific things you wanted to be taken care of, please let me know I'd be happy to. |
out of the last 3 tests that still fail:
Overall having to adjust precisions seems to be ... inefficent? error-prone? I guess there is a way better method for doing that. I need to have a look at RSA how they did it there. |
a5b6804
to
fde178e
Compare
Seems like even |
Scratch that, it existed, I just didn't see it at that time |
@baloo the precision aspect is definitely a bit tricky. |
Oh I understand why it's done! I'm just not sure I know what I'm doing [insert here the picture of a dog]. |
26e40ac
to
03f4d7a
Compare
okay, it's definitely on the ugly side, but tests do pass \o/ I think I got the hang of it, I think I can clean things up from there, but ... tomorrow. |
Nice! I mean I have a few hours to kill today, too, so I can go ahead and try to clean up some things, too. I'll PR it into your fork when I get to it |
a481afb
to
71639a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those two NonZero
I'm not sure about.
// TODO(baloo): is there any way R could be zero here? Could it be any reason for K to be | ||
// one? | ||
let r_short = NonZero::new(r_short).unwrap(); | ||
let r = NonZero::new(r).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this unwrap, isn't there a way for r = g.modpow(k, p) % q
to be zero?
// TODO(baloo): is there any way S could be zero here? | ||
let s = NonZero::new(s).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly here, s
could be zero?
6e1a74c
to
c0a9f41
Compare
required because of crypto-bigint
c0a9f41
to
5fd1ebc
Compare
This is a rebase of #784
There are two commits on top that I think should fix tests. There is a bit of cleanup to do still.