/** * Class to help with Blake2B Signature scheme. * TypeScript conversion from https://github.com/dcposch/blakejs. */ export declare class Blake2b { /** * Blake2b 160. */ static SIZE_160: number; /** * Blake2b 256. */ static SIZE_256: number; /** * Blake2b 512. */ static SIZE_512: number; /** * Initialization Vector. * @internal */ private static readonly BLAKE2B_IV32; /** * Initialization Vector. * @internal */ private static readonly SIGMA8; /** * These are offsets into a uint64 buffer. * Multiply them all by 2 to make them offsets into a uint32 buffer, * because this is Javascript and we don't have uint64s * @internal */ private static readonly SIGMA82; /** * The V vector. * @internal */ private _v; /** * The M vector. * @internal */ private _m; /** * The context for the current hash. * @internal */ private _context; /** * Create a new instance of Blake2b. * @param outlen Output length between 1 and 64 bytes. * @param key Optional key. */ constructor(outlen: number, key?: Uint8Array); /** * Perform Sum 160 on the data. * @param data The data to operate on. * @param key Optional key for the hash. * @returns The sum 160 of the data. */ static sum160(data: Uint8Array, key?: Uint8Array): Uint8Array; /** * Perform Sum 256 on the data. * @param data The data to operate on. * @param key Optional key for the hash. * @returns The sum 256 of the data. */ static sum256(data: Uint8Array, key?: Uint8Array): Uint8Array; /** * Perform Sum 512 on the data. * @param data The data to operate on. * @param key Optional key for the hash. * @returns The sum 512 of the data. */ static sum512(data: Uint8Array, key?: Uint8Array): Uint8Array; /** * Updates a BLAKE2b streaming hash. * @param input The data to hash. */ update(input: Uint8Array): void; /** * Completes a BLAKE2b streaming hash. * @returns The final data. */ final(): Uint8Array; /** * Creates a BLAKE2b hashing context. * @param outlen Output length between 1 and 64 bytes. * @param key Optional key. */ private init; /** * Compression. * Note we're representing 16 uint64s as 32 uint32s * @param last Is this the last block. * @internal */ private compress; /** * 64-bit unsigned addition * Sets v[a,a+1] += v[b,b+1] * @param v The array. * @param a The a index. * @param b The b index. * @internal */ private add64AA; /** * 64-bit unsigned addition. * Sets v[a,a+1] += b. * @param v The array of data to work on. * @param a The index to use. * @param b0 Is the low 32 bits. * @param b1 Represents the high 32 bits. * @internal */ private add64AC; /** * Little endian read byte 32; * @param arr The array to read from . * @param i The index to start reading from. * @returns The value. * @internal */ private b2bGet32; /** * G Mixing function. * The ROTRs are inlined for speed. * @param a The a value. * @param b The b value. * @param c The c value. * @param d The d value. * @param ix The ix value. * @param iy The iy value. * @internal */ private b2bG; }