Bitwise encryption hybrids #
Replace an initial segment of a word by zeros before encrypting its bits. A simulator samples the surrounding ciphertexts and inserts one challenge ciphertext at the selected coordinate. The exact distributional identities retain every other ciphertext and its independent encryption randomness. They also apply inside a larger randomized context.
Main definitions #
Cslib.Crypto.Homomorphic.Scheme.encryptBitsHybrid: encrypt a word with a zero prefix.Cslib.Crypto.Homomorphic.Scheme.spliceEncryptedBit: insert a bit-encryption challenge.
Main results #
Cslib.Crypto.Homomorphic.Scheme.eval_spliceEncryptedBit_original: the original bit gives the earlier adjacent hybrid.Cslib.Crypto.Homomorphic.Scheme.eval_spliceEncryptedBit_zero: a zero bit gives the next adjacent hybrid.
References #
@[simp]
theorem Cslib.Crypto.Homomorphic.Scheme.encryptBitsHybrid_zero (E : Scheme) (n : ℕ) (pk bits : List Bool) :
The initial bit hybrid is the actual bitwise encryption sampler.
theorem Cslib.Crypto.Homomorphic.Scheme.encryptBitsHybrid_length (E : Scheme) (n : ℕ) (pk bits : List Bool) :
The final bit hybrid encrypts an equal-length zero word.
theorem Cslib.Crypto.Homomorphic.Scheme.eval_spliceEncryptedBit_original (E : Scheme) (n : ℕ) (pk bits : List Bool) (cut : ℕ) (hcut : cut < bits.length) :
(do
let challenge ← E.encrypt n pk (bits.getD cut false)
E.spliceEncryptedBit n pk cut (List.drop (cut + 1) bits) challenge).eval = (E.encryptBitsHybrid n pk bits cut).eval
An encryption of the selected original bit supplies the earlier adjacent hybrid.
theorem Cslib.Crypto.Homomorphic.Scheme.eval_spliceEncryptedBit_zero (E : Scheme) (n : ℕ) (pk bits : List Bool) (cut : ℕ) (hcut : cut < bits.length) :
(do
let challenge ← E.encrypt n pk false
E.spliceEncryptedBit n pk cut (List.drop (cut + 1) bits) challenge).eval = (E.encryptBitsHybrid n pk bits (cut + 1)).eval
An encryption of zero supplies the next adjacent hybrid.