/** * TDD - Tensor Decomposition Distinguishing Problem * * Based on the hardness of tensor decomposition (NP-hard in general). * No known quantum speedup exists for this problem. * * Problem: Given noisy tensor T, distinguish whether T has low-rank decomposition * * Security Properties: * - Based on tensor rank decomposition hardness (NP-hard) * - For n-dimensional tensors with rank r, security ≈ O(n^r) * - No known quantum algorithms provide significant speedup * - Parameters: n=24 (MOS-128), n=36 (MOS-256) with rank r=6/9 * * Performance: * - Tensor operations are O(n³) for n×n×n tensors * - Optimized with delayed modular reduction * - Most expensive of the three kMOSAIC problems */ import type { TDDParams, TDDPublicKey, TDDSecretKey, TDDCiphertext } from '../../types.js'; export interface TDDKeyPair { publicKey: TDDPublicKey; secretKey: TDDSecretKey; } /** * Generate TDD key pair * * Key structure: * - Secret key: r factor triples (aᵢ, bᵢ, cᵢ) defining low-rank tensor * - Public key: T = Σᵢ aᵢ ⊗ bᵢ ⊗ cᵢ + E (noisy tensor) * * Security: Recovering the factor decomposition from the noisy tensor * is believed to be hard (tensor decomposition is NP-hard in general). * * @param params - TDD parameters * @param seed - Random seed * @returns Key pair */ export declare function tddKeyGen(params: TDDParams, seed: Uint8Array): TDDKeyPair; /** * TDD Encryption (for KEM) * Encodes a message fragment using the tensor public key * * Encryption algorithm: * 1. Encode message bytes as Z_q coefficients λ * 2. Compute contracted product T ×₁ λ * 3. Add random masking matrix * 4. Include hint and message for recovery * * Security: Random masking provides IND-CPA security. * * @param publicKey - Recipient's public key * @param message - Message to encrypt * @param params - TDD parameters * @param randomness - Randomness for encryption * @returns Ciphertext */ export declare function tddEncrypt(publicKey: TDDPublicKey, message: Uint8Array, params: TDDParams, randomness: Uint8Array): TDDCiphertext; /** * TDD Decryption (for KEM) * * Decryption algorithm: * 1. Extract masked matrix and encrypted message from ciphertext * 2. Recompute contracted product using secret factors * 3. Derive keystream and XOR decrypt the message * * Security: Decryption requires knowledge of the tensor decomposition * to recompute the contracted product used in keystream derivation. * * @param ciphertext - Ciphertext to decrypt * @param secretKey - Recipient's secret key * @param params - TDD parameters * @returns Decrypted message */ export declare function tddDecrypt(ciphertext: TDDCiphertext, secretKey: TDDSecretKey, params: TDDParams): Uint8Array; /** * Serialize TDD public key * * @param pk - Public key * @returns Serialized bytes */ export declare function tddSerializePublicKey(pk: TDDPublicKey): Uint8Array; /** * Deserialize TDD public key * * @param data - Serialized bytes * @returns Public key */ export declare function tddDeserializePublicKey(data: Uint8Array): TDDPublicKey; //# sourceMappingURL=index.d.ts.map