/** * XOR operations for BrightChain. * * All XOR operations in BrightChain use equal-length arrays for whitening/brightening. * This is NOT a repeating-key cipher - arrays must always be the same length. */ export declare class XorService { /** * XOR two Uint8Arrays of equal length. * For BrightChain whitening/brightening operations, we always XOR equal-length blocks. * * Properties: * - Self-inverse: (A ⊕ B) ⊕ B = A * - Commutative: A ⊕ B = B ⊕ A * - Associative: (A ⊕ B) ⊕ C = A ⊕ (B ⊕ C) * * @param a The first array to XOR. * @param b The second array to XOR (same length as a). * @returns A new Uint8Array containing the result of the XOR operation. * @throws Error if arrays have different lengths. */ static xor(a: Uint8Array, b: Uint8Array): Uint8Array; /** * XOR multiple equal-length arrays together. * Used for brightening operations where a source block is XORed with multiple random blocks. * * @param arrays Array of Uint8Arrays to XOR together (all must be same length) * @returns A new Uint8Array containing the XOR of all input arrays * @throws Error if arrays have different lengths or if no arrays provided */ static xorMultiple(arrays: Uint8Array[]): Uint8Array; /** * Generates a random key of a specified length. * @param length The length of the key in bytes. * @returns A Uint8Array containing the random key. * @throws Error if crypto API is not available. */ static generateKey(length: number): Uint8Array; /** * Helper method to convert a string to a Uint8Array. * @param str The string to convert. * @returns A Uint8Array representation of the string. */ static stringToBytes(str: string): Uint8Array; /** * Helper method to convert a Uint8Array to a string. * @param bytes The Uint8Array to convert. * @returns A string representation of the Uint8Array. */ static bytesToString(bytes: Uint8Array): string; } //# sourceMappingURL=xor.d.ts.map