montgomery.d.ts 900 B

1234567891011121314151617181920212223242526
  1. type Hex = string | Uint8Array;
  2. export type CurveType = {
  3. P: bigint;
  4. nByteLength: number;
  5. adjustScalarBytes?: (bytes: Uint8Array) => Uint8Array;
  6. domain?: (data: Uint8Array, ctx: Uint8Array, phflag: boolean) => Uint8Array;
  7. a: bigint;
  8. montgomeryBits: number;
  9. powPminus2?: (x: bigint) => bigint;
  10. xyToU?: (x: bigint, y: bigint) => bigint;
  11. Gu: bigint;
  12. randomBytes?: (bytesLength?: number) => Uint8Array;
  13. };
  14. export type CurveFn = {
  15. scalarMult: (scalar: Hex, u: Hex) => Uint8Array;
  16. scalarMultBase: (scalar: Hex) => Uint8Array;
  17. getSharedSecret: (privateKeyA: Hex, publicKeyB: Hex) => Uint8Array;
  18. getPublicKey: (privateKey: Hex) => Uint8Array;
  19. utils: {
  20. randomPrivateKey: () => Uint8Array;
  21. };
  22. GuBytes: Uint8Array;
  23. };
  24. export declare function montgomery(curveDef: CurveType): CurveFn;
  25. export {};
  26. //# sourceMappingURL=montgomery.d.ts.map