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

some mathematic problems #1258

Closed
davidchen2014 opened this issue Oct 17, 2022 · 1 comment
Closed

some mathematic problems #1258

davidchen2014 opened this issue Oct 17, 2022 · 1 comment

Comments

@davidchen2014
Copy link

davidchen2014 commented Oct 17, 2022

Hi, I'm newcomer here and interested at some basic source code. But I met some trouble when reading some source code phrases at https://github.com/bcgit/bc-java/blob/master/core/src/main/java/org/bouncycastle/math/ec/custom/sec/SecP128R1Field.java
Especially at following part:
image

I can understand these phrase Nat128.mul(x, y, tt); .
But I don't understand next phrase reduce(tt, z);
especially at following part:
image

I can understand that the reduce process is rearranging array X to array Z., but don't understand the structure behind these and why do this.

And next question is: I also don't understand isZero method in the same class
image

Why always shifting left 1 or shifting right 1 among these code?
image
image

I'm very appreciated if receiving your returning message, guidance , related samples and mathematics-related materials!

Thanks in advance.

@davidchen2014 davidchen2014 changed the title some mathematics confuse some mathematic problems Oct 17, 2022
@davidchen2014
Copy link
Author

I have solved these problems by myself, and understand knowledge behind these.
These codes is related to secp128r1 fast-reduce procedure. Furthermore I have learned secp192r1 and secp256r1 fast-reduce procedures.

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

No branches or pull requests

1 participant