필터 지우기
필터 지우기

elliptic curves and finite fields in Matlab

조회 수: 6 (최근 30일)
Hao Sun
Hao Sun 2019년 11월 21일
편집: John D'Errico 2022년 12월 28일
Hi,
How to work over finite fields in matlab? Finding inverses also algebraic closure of finite fields.
Also how to work with elliptic curves over finite fields in matlab specifically point addition.
To clarify I'm looking for software/built in functions that can do this not to do this myself.
  댓글 수: 1
David Hill
David Hill 2019년 11월 21일
You may want to look at my file exchanges: secp256k1, curve448, curve25519
If you inspect the functions you will be able to see how I did point addition, and inverses.

댓글을 달려면 로그인하십시오.

답변 (2개)

Truman
Truman 2022년 12월 27일
Short answer is Matlab is not the best tool to analyze finite fields, field extensions of finite fields, elliptic curves over finite fields (or even the rationals). Matlat excells for "engineering" applications but not for general mathematical applications.
For what you want, Mathematica with its build in function over finite fields and handing of symbolic mathematics is a better choice.

John D'Errico
John D'Errico 2022년 12월 28일
편집: John D'Errico 2022년 12월 28일
An inverse is trivial in MATLAB. Just use gcd. That is, if you want to solve the problem
a*x = 1, mod P
where a and P are given and relatively prime, then the inverse comes directly from
[G,C,D] = gcd(a,P).
The inverse has no solution if G ~= 1. For example...
a = 12;
P = nextprime(sym('1e12'))
P = 
1000000000039
[G,C,D] = gcd(a,P)
G = 
1
C = 
416666666683
D = 
Again, as long as they are relatively prime so that G == 1, then we have
G = C*a + D*P
Modulo P, we know that C*a == 1, and so C is the multiplicative inverse of a in the corresponding field.
If you want, you can find my modInv on the File Exchange, which does exactly this. And, GCD is a built-in part of MATLAB.
Is Mathematica better at these things? Probably so.

카테고리

Help CenterFile Exchange에서 Discrete Math에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by