# CKKS add scalar To add a specific scalar to all slots of an encrypted plaintext we need to encode it i.e., compute inverse-FFT and then multiply the output coefficients by the scheme scale. for scalar $a$, we get inverse-FFT($a,...,a$)=$(a,0,...,0)$ because 1) the rows of the inverse-FFT matrix contains all n-th roots of unity except the first row which contains only ones 2) The sum of all n-th roots of unity equal to zero. This means we can add the constant polynomial $a$ to the plaintext i.e., add this polynomial to $b(x)$ where $ct:=(b(x),a(x))$ . For ciphertext with CRT representation, we can add $a\bmod q_i$ in the $t\cdot i$ index for $t=0,...,L$ where $L$ is the total number of limbs. This index is the constant coefficient for RNS limb of $q_i$ prime. For ciphertext with nega-cyclic-NTT representation, we compute $NTT(a \bmod q_i,0,...,0)$ for which is equal to the first column of the NTT matrix multiplied by $a \bmod q_i$ for the i-th limb. This column is $(1,...,1)$ so we need to add the vector $(a \bmod q_i,...,a \bmod q_i)$ to the i-th limb. Adding a specific scalar to a ciphertext is more efficiently than adding a vector with different values to encrypted plaintext slots. ## Created 2026-05-26 16:58