/** * The HCA cipher type. Stored as a u16 in the `ciph` header. * Type 0 = plain, 1 = static obfuscation, 56 = key-derived. */ export type CiphType = 0 | 1 | 56; /** * Build the 256-entry HCA cipher substitution table for the * given type and (for type 56) the two 32-bit halves of the * 64-bit key. The output `table` array — which must be * `>= 256` long — is filled in place. * * Returns `true` on success and `false` for an unrecognised * cipher type. */ export declare function initCiphTable(table: Uint8Array, type: number, key1?: number, key2?: number): boolean; /** * In-place block decrypt. Each byte `b` is replaced with * `table[b]`. For a type-0 cipher this is a no-op (the table * is the identity). */ export declare function decryptBlock(table: Uint8Array, block: Uint8Array): void; /** * Combine the user-provided 64-bit HCA key with the per-AWB * `awbKey` (a 16-bit "subkey" that AWB containers tack on top * of the file-level key). For standalone HCAs `awbKey` is 0 * and this returns the input unchanged. * * Matches CriTools' formula: * key = (key * ((awbKey << 16) | ((~awbKey & 0xFFFF) + 2))) mod 2^64 */ export declare function combineAwbKey(key: bigint, awbKey: number): bigint; /** * Split a 64-bit BigInt key into the two unsigned 32-bit halves * (`[lo, hi]`) used by {@link initCiphTable} for type-56. */ export declare function splitKey64(key: bigint): [number, number];