pasta.js 966 B

123456789101112131415161718192021222324252627282930
  1. /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
  2. import { sha256 } from '@noble/hashes/sha256';
  3. import { getHash } from './_shortw_utils.js';
  4. import { Field, mod } from './abstract/modular.js';
  5. import { weierstrass } from './abstract/weierstrass.js';
  6. export const p = BigInt('0x40000000000000000000000000000000224698fc094cf91b992d30ed00000001');
  7. export const q = BigInt('0x40000000000000000000000000000000224698fc0994a8dd8c46eb2100000001');
  8. // https://neuromancer.sk/std/other/Pallas
  9. export const pallas = weierstrass({
  10. a: BigInt(0),
  11. b: BigInt(5),
  12. Fp: Field(p),
  13. n: q,
  14. Gx: mod(BigInt(-1), p),
  15. Gy: BigInt(2),
  16. h: BigInt(1),
  17. ...getHash(sha256),
  18. });
  19. // https://neuromancer.sk/std/other/Vesta
  20. export const vesta = weierstrass({
  21. a: BigInt(0),
  22. b: BigInt(5),
  23. Fp: Field(q),
  24. n: p,
  25. Gx: mod(BigInt(-1), q),
  26. Gy: BigInt(2),
  27. h: BigInt(1),
  28. ...getHash(sha256),
  29. });
  30. //# sourceMappingURL=pasta.js.map