sky59 / Kangaroo-254-bit

GNU General Public License v3.0
3 stars 2 forks source link

adapt BSGS alg for eliptic curve secp256r1 #1

Open Xpeppo opened 2 years ago

Xpeppo commented 2 years ago

Hi, I'm trying to adapt BSGS alg for eliptic curve secp256r1

I already set up the proper a,b,p,n, and G points

I saw on your discussion in another forum that the "reduction" in Montgomery maths needs to be rewritten, you talked it was necessary to perform 9 reduction steps instead of 2 in Montgomery reduction - what that it means?

I understand the Reduction function is in Point.cpp file

void Point::Reduce() { Int i(&z); i.ModInv(); x.ModMul(&x,&i); y.ModMul(&y,&i); z.SetInt32(1); }

Performing 9 reduction instead of 2, means to call 9 times this function? Or rather to change the x.ModMul(&x,&i); y.ModMul(&y,&i); part, by adding 9 times those operations (So repeat 9 times the x and y.ModMul ?

I would appreciate your help to have this working for secp256r1 curve regards

sky59 commented 2 years ago

I was not here some time....

What you write it means you are a beginner. So I attach for you linux version bsgs. You need to change permittions, run it on Ubuntu 20.04
You can test it with attached file txt

I know you and also me need private key for green pass. If you have one or manage to get one I give you also source code.
It is much more changes than just Montgomery reduction. There are some constants in the program also which needs to be changed

I adapted it only for CPU, forget GPU - this is still for K1 curve.

Wed, 05 Jan 2022 18:00:22 +0000 (UTC) - "sky59/Kangaroo-254-bit" **@.*>

Hi, I'm trying to adapt BSGS alg for eliptic curve secp256r1

I already set up the proper a,b,p,n, and G points

I saw on your discussion in another forum that the "reduction" in Montgomery maths needs to be rewritten, you talked it was necessary to perform 9 reduction steps instead of 2 in Montgomery reduction - what that it means?

I understand the Reduction function is in Point.cpp file

void Point::Reduce() {
Int i(&z);
i.ModInv();
x.ModMul(&x,&i);
y.ModMul(&y,&i);
z.SetInt32(1);
}

Performing 9 reduction instead of 2, means to call 9 times this function? Or rather to change the
x.ModMul(&x,&i);
y.ModMul(&y,&i);
part, by adding 9 times those operations (So repeat 9 times the x and y.ModMul ?

I would appreciate your help to have this working for secp256r1 curve
regards


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: @.***>