bn254.js 1.1 KB

1234567891011121314151617181920212223242526
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.bn254 = 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. /**
  10. * bn254 pairing-friendly curve.
  11. * Previously known as alt_bn_128, when it had 128-bit security.
  12. * Barbulescu-Duquesne 2017 shown it's weaker: just about 100 bits,
  13. * so the naming has been adjusted to its prime bit count
  14. * https://hal.science/hal-01534101/file/main.pdf
  15. */
  16. exports.bn254 = (0, weierstrass_js_1.weierstrass)({
  17. a: BigInt(0),
  18. b: BigInt(3),
  19. Fp: (0, modular_js_1.Field)(BigInt('0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47')),
  20. n: BigInt('0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001'),
  21. Gx: BigInt(1),
  22. Gy: BigInt(2),
  23. h: BigInt(1),
  24. ...(0, _shortw_utils_js_1.getHash)(sha256_1.sha256),
  25. });
  26. //# sourceMappingURL=bn254.js.map