pasta.js 1.3 KB

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