/** * HMAC: RFC2104 message authentication code. * @module */ import { type CHash, type Hash, type TArg, type TRet } from './utils.ts'; /** * Internal class for HMAC. * Accepts any byte key, although RFC 2104 ยง3 recommends keys at least * `HashLen` bytes long. */ export declare class _HMAC> implements Hash<_HMAC> { oHash: T; iHash: T; blockLen: number; outputLen: number; canXOF: boolean; private finished; private destroyed; constructor(hash: TArg, key: TArg); update(buf: TArg): this; digestInto(out: TArg): void; digest(): TRet; _cloneInto(to?: _HMAC): _HMAC; clone(): _HMAC; destroy(): void; } /** * HMAC: RFC2104 message authentication code. * @param hash - function that would be used e.g. sha256 * @param key - authentication key bytes * @param message - message bytes to authenticate * @returns Authentication tag bytes. * @example * Compute an RFC 2104 HMAC. * ```ts * import { hmac } from '@noble/hashes/hmac.js'; * import { sha256 } from '@noble/hashes/sha2.js'; * const mac = hmac(sha256, new Uint8Array([1, 2, 3]), new Uint8Array([4, 5, 6])); * ``` */ type HmacFn = { (hash: TArg, key: TArg, message: TArg): TRet; create(hash: TArg, key: TArg): TRet<_HMAC>; }; export declare const hmac: TRet; export {}; //# sourceMappingURL=hmac.d.ts.map