bls12-381.d.ts 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import { CurveFn } from './abstract/bls.js';
  2. import * as mod from './abstract/modular.js';
  3. declare const Fp: Readonly<mod.IField<bigint> & Required<Pick<mod.IField<bigint>, "isOdd">>>;
  4. type Fp = bigint;
  5. type BigintTuple = [bigint, bigint];
  6. type Fp2 = {
  7. c0: bigint;
  8. c1: bigint;
  9. };
  10. type Fp2Utils = {
  11. fromBigTuple: (tuple: BigintTuple | bigint[]) => Fp2;
  12. reim: (num: Fp2) => {
  13. re: bigint;
  14. im: bigint;
  15. };
  16. mulByNonresidue: (num: Fp2) => Fp2;
  17. multiplyByB: (num: Fp2) => Fp2;
  18. frobeniusMap(num: Fp2, power: number): Fp2;
  19. };
  20. declare const Fp2: mod.IField<Fp2> & Fp2Utils;
  21. type BigintSix = [bigint, bigint, bigint, bigint, bigint, bigint];
  22. type Fp6 = {
  23. c0: Fp2;
  24. c1: Fp2;
  25. c2: Fp2;
  26. };
  27. type Fp6Utils = {
  28. fromBigSix: (tuple: BigintSix) => Fp6;
  29. mulByNonresidue: (num: Fp6) => Fp6;
  30. frobeniusMap(num: Fp6, power: number): Fp6;
  31. multiplyBy1(num: Fp6, b1: Fp2): Fp6;
  32. multiplyBy01(num: Fp6, b0: Fp2, b1: Fp2): Fp6;
  33. multiplyByFp2(lhs: Fp6, rhs: Fp2): Fp6;
  34. };
  35. declare const Fp6: mod.IField<Fp6> & Fp6Utils;
  36. type Fp12 = {
  37. c0: Fp6;
  38. c1: Fp6;
  39. };
  40. type BigintTwelve = [
  41. bigint,
  42. bigint,
  43. bigint,
  44. bigint,
  45. bigint,
  46. bigint,
  47. bigint,
  48. bigint,
  49. bigint,
  50. bigint,
  51. bigint,
  52. bigint
  53. ];
  54. type Fp12Utils = {
  55. fromBigTwelve: (t: BigintTwelve) => Fp12;
  56. frobeniusMap(num: Fp12, power: number): Fp12;
  57. multiplyBy014(num: Fp12, o0: Fp2, o1: Fp2, o4: Fp2): Fp12;
  58. multiplyByFp2(lhs: Fp12, rhs: Fp2): Fp12;
  59. conjugate(num: Fp12): Fp12;
  60. finalExponentiate(num: Fp12): Fp12;
  61. _cyclotomicSquare(num: Fp12): Fp12;
  62. _cyclotomicExp(num: Fp12, n: bigint): Fp12;
  63. };
  64. declare const Fp12: mod.IField<Fp12> & Fp12Utils;
  65. export declare const bls12_381: CurveFn<Fp, Fp2, Fp6, Fp12>;
  66. export {};
  67. //# sourceMappingURL=bls12-381.d.ts.map