p384.d.ts 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. export declare const p384: Readonly<{
  2. create: (hash: import("./abstract/utils.js").CHash) => import("./abstract/weierstrass.js").CurveFn;
  3. CURVE: ReturnType<(curve: import("./abstract/weierstrass.js").CurveType) => Readonly<{
  4. readonly nBitLength: number;
  5. readonly nByteLength: number;
  6. readonly Fp: import("./abstract/modular.js").IField<bigint>;
  7. readonly n: bigint;
  8. readonly h: bigint;
  9. readonly hEff?: bigint;
  10. readonly Gx: bigint;
  11. readonly Gy: bigint;
  12. readonly allowInfinityPoint?: boolean;
  13. readonly a: bigint;
  14. readonly b: bigint;
  15. readonly allowedPrivateKeyLengths?: readonly number[];
  16. readonly wrapPrivateKey?: boolean;
  17. readonly endo?: {
  18. beta: bigint;
  19. splitScalar: (k: bigint) => {
  20. k1neg: boolean;
  21. k1: bigint;
  22. k2neg: boolean;
  23. k2: bigint;
  24. };
  25. };
  26. readonly isTorsionFree?: ((c: import("./abstract/weierstrass.js").ProjConstructor<bigint>, point: import("./abstract/weierstrass.js").ProjPointType<bigint>) => boolean) | undefined;
  27. readonly clearCofactor?: ((c: import("./abstract/weierstrass.js").ProjConstructor<bigint>, point: import("./abstract/weierstrass.js").ProjPointType<bigint>) => import("./abstract/weierstrass.js").ProjPointType<bigint>) | undefined;
  28. readonly hash: import("./abstract/utils.js").CHash;
  29. readonly hmac: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array;
  30. readonly randomBytes: (bytesLength?: number) => Uint8Array;
  31. lowS: boolean;
  32. readonly bits2int?: (bytes: Uint8Array) => bigint;
  33. readonly bits2int_modN?: (bytes: Uint8Array) => bigint;
  34. readonly p: bigint;
  35. }>>;
  36. getPublicKey: (privateKey: import("./abstract/utils.js").PrivKey, isCompressed?: boolean) => Uint8Array;
  37. getSharedSecret: (privateA: import("./abstract/utils.js").PrivKey, publicB: import("./abstract/utils.js").Hex, isCompressed?: boolean) => Uint8Array;
  38. sign: (msgHash: import("./abstract/utils.js").Hex, privKey: import("./abstract/utils.js").PrivKey, opts?: import("./abstract/weierstrass.js").SignOpts) => import("./abstract/weierstrass.js").RecoveredSignatureType;
  39. verify: (signature: import("./abstract/utils.js").Hex | {
  40. r: bigint;
  41. s: bigint;
  42. }, msgHash: import("./abstract/utils.js").Hex, publicKey: import("./abstract/utils.js").Hex, opts?: import("./abstract/weierstrass.js").VerOpts) => boolean;
  43. ProjectivePoint: import("./abstract/weierstrass.js").ProjConstructor<bigint>;
  44. Signature: import("./abstract/weierstrass.js").SignatureConstructor;
  45. utils: {
  46. normPrivateKeyToScalar: (key: import("./abstract/utils.js").PrivKey) => bigint;
  47. isValidPrivateKey(privateKey: import("./abstract/utils.js").PrivKey): boolean;
  48. randomPrivateKey: () => Uint8Array;
  49. precompute: (windowSize?: number, point?: import("./abstract/weierstrass.js").ProjPointType<bigint>) => import("./abstract/weierstrass.js").ProjPointType<bigint>;
  50. };
  51. }>;
  52. export declare const secp384r1: Readonly<{
  53. create: (hash: import("./abstract/utils.js").CHash) => import("./abstract/weierstrass.js").CurveFn;
  54. CURVE: ReturnType<(curve: import("./abstract/weierstrass.js").CurveType) => Readonly<{
  55. readonly nBitLength: number;
  56. readonly nByteLength: number;
  57. readonly Fp: import("./abstract/modular.js").IField<bigint>;
  58. readonly n: bigint;
  59. readonly h: bigint;
  60. readonly hEff?: bigint;
  61. readonly Gx: bigint;
  62. readonly Gy: bigint;
  63. readonly allowInfinityPoint?: boolean;
  64. readonly a: bigint;
  65. readonly b: bigint;
  66. readonly allowedPrivateKeyLengths?: readonly number[];
  67. readonly wrapPrivateKey?: boolean;
  68. readonly endo?: {
  69. beta: bigint;
  70. splitScalar: (k: bigint) => {
  71. k1neg: boolean;
  72. k1: bigint;
  73. k2neg: boolean;
  74. k2: bigint;
  75. };
  76. };
  77. readonly isTorsionFree?: ((c: import("./abstract/weierstrass.js").ProjConstructor<bigint>, point: import("./abstract/weierstrass.js").ProjPointType<bigint>) => boolean) | undefined;
  78. readonly clearCofactor?: ((c: import("./abstract/weierstrass.js").ProjConstructor<bigint>, point: import("./abstract/weierstrass.js").ProjPointType<bigint>) => import("./abstract/weierstrass.js").ProjPointType<bigint>) | undefined;
  79. readonly hash: import("./abstract/utils.js").CHash;
  80. readonly hmac: (key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array;
  81. readonly randomBytes: (bytesLength?: number) => Uint8Array;
  82. lowS: boolean;
  83. readonly bits2int?: (bytes: Uint8Array) => bigint;
  84. readonly bits2int_modN?: (bytes: Uint8Array) => bigint;
  85. readonly p: bigint;
  86. }>>;
  87. getPublicKey: (privateKey: import("./abstract/utils.js").PrivKey, isCompressed?: boolean) => Uint8Array;
  88. getSharedSecret: (privateA: import("./abstract/utils.js").PrivKey, publicB: import("./abstract/utils.js").Hex, isCompressed?: boolean) => Uint8Array;
  89. sign: (msgHash: import("./abstract/utils.js").Hex, privKey: import("./abstract/utils.js").PrivKey, opts?: import("./abstract/weierstrass.js").SignOpts) => import("./abstract/weierstrass.js").RecoveredSignatureType;
  90. verify: (signature: import("./abstract/utils.js").Hex | {
  91. r: bigint;
  92. s: bigint;
  93. }, msgHash: import("./abstract/utils.js").Hex, publicKey: import("./abstract/utils.js").Hex, opts?: import("./abstract/weierstrass.js").VerOpts) => boolean;
  94. ProjectivePoint: import("./abstract/weierstrass.js").ProjConstructor<bigint>;
  95. Signature: import("./abstract/weierstrass.js").SignatureConstructor;
  96. utils: {
  97. normPrivateKeyToScalar: (key: import("./abstract/utils.js").PrivKey) => bigint;
  98. isValidPrivateKey(privateKey: import("./abstract/utils.js").PrivKey): boolean;
  99. randomPrivateKey: () => Uint8Array;
  100. precompute: (windowSize?: number, point?: import("./abstract/weierstrass.js").ProjPointType<bigint>) => import("./abstract/weierstrass.js").ProjPointType<bigint>;
  101. };
  102. }>;
  103. export declare const hashToCurve: (msg: Uint8Array, options?: import("./abstract/hash-to-curve.js").htfBasicOpts) => import("./abstract/hash-to-curve.js").H2CPoint<bigint>;
  104. export declare const encodeToCurve: (msg: Uint8Array, options?: import("./abstract/hash-to-curve.js").htfBasicOpts) => import("./abstract/hash-to-curve.js").H2CPoint<bigint>;
  105. //# sourceMappingURL=p384.d.ts.map