UNPKG

tink-crypto

Version:

A multi-language, cross-platform library that provides cryptographic APIs that are secure, easy to use correctly, and hard(er) to misuse.

33 lines (32 loc) 851 B
/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { Mac } from '../mac/internal/mac'; /** * Implementation of HMAC. * * @final */ export declare class Hmac extends Mac { private readonly hash; private readonly key; private readonly tagSize; /** * @param hash accepted names are SHA-1, SHA-256 and SHA-512 * @param tagSize the size of the tag */ constructor(hash: string, key: CryptoKey, tagSize: number); /** */ computeMac(data: Uint8Array): Promise<Uint8Array>; /** */ verifyMac(tag: Uint8Array, data: Uint8Array): Promise<boolean>; } /** * @param hash accepted names are SHA-1, SHA-256 and SHA-512 * @param tagSize the size of the tag */ export declare function fromRawKey(hash: string, key: Uint8Array, tagSize: number): Promise<Mac>;