Skip to content

Commit

Permalink
collect curve params on one object
Browse files Browse the repository at this point in the history
  • Loading branch information
mitschabaude committed Nov 22, 2023
1 parent 6746813 commit 3a40f7d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions crypto/elliptic-curve-examples.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { CurveParams, Pallas, Vesta } from './elliptic_curve.js';
import { exampleFields } from './finite-field-examples.js';

export { secp256k1Params, pallasParams, vestaParams };
export { CurveParams };

const secp256k1Params: CurveParams = {
name: 'secp256k1',
modulus: 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2fn,
order: 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n,
modulus: exampleFields.secp256k1.modulus,
order: exampleFields.secq256k1.modulus,
a: 0n,
b: 7n,
generator: {
Expand All @@ -31,3 +32,9 @@ const vestaParams: CurveParams = {
b: Vesta.b,
generator: Vesta.one,
};

const CurveParams = {
Secp256k1: secp256k1Params,
Pallas: pallasParams,
Vesta: vestaParams,
};

0 comments on commit 3a40f7d

Please sign in to comment.