hmac.d.ts 781 B

1234567891011121314151617181920212223242526
  1. import { Hash, CHash, Input } from './utils.js';
  2. export declare class HMAC<T extends Hash<T>> extends Hash<HMAC<T>> {
  3. oHash: T;
  4. iHash: T;
  5. blockLen: number;
  6. outputLen: number;
  7. private finished;
  8. private destroyed;
  9. constructor(hash: CHash, _key: Input);
  10. update(buf: Input): this;
  11. digestInto(out: Uint8Array): void;
  12. digest(): Uint8Array;
  13. _cloneInto(to?: HMAC<T>): HMAC<T>;
  14. destroy(): void;
  15. }
  16. /**
  17. * HMAC: RFC2104 message authentication code.
  18. * @param hash - function that would be used e.g. sha256
  19. * @param key - message key
  20. * @param message - message data
  21. */
  22. export declare const hmac: {
  23. (hash: CHash, key: Input, message: Input): Uint8Array;
  24. create(hash: CHash, key: Input): HMAC<any>;
  25. };
  26. //# sourceMappingURL=hmac.d.ts.map