Homomorphic SIM 2 D operations: Single Instruction Much More Data Wouter Castryck Ilia Iliashenko Frederik Vercauteren
Homomorphic encryption ๐ท ๐ท cryp 175.2 ยงรง{ร #ยฃ*ยฐ|
Homomorphic encoding real-world data plaintext ciphertext ๐ท ๐ท ๐ท cryp 2๐ฆ 1023 + ๐ฆ 2 + 7๐ฆ + 5 175.2 ยงรง{ร #ยฃ*ยฐ|
Plaintext space ๐[๐ฆ] Typically a ring of the form ๐ ๐ข = (๐ ๐ฆ , ๐ข) where ๐ข โ ๐ โฅ2 and ๐ ๐ฆ โ ๐[๐ฆ] is monic irreducible of degree ๐ . We represent this by a box: ๐๐ฆ ๐ ๐ ๐ข -direction Polynomials of degree < ๐ ๐ and coefficients in [0, ๐ข) . ๐ -direction
๐ -direction Homomorphic encoding ๐ข -direction How to encode real-world input ๐ ? General principle: find an integer-digit expansion ๐ โ ๐ ๐ ๐ ๐ + ๐ ๐ โ1 ๐ ๐ โ1 + โฏ + ๐ 1 ๐ + ๐ 0 for some base ๐ โ ๐ . Then encode as ๐ ๐ ๐ฆ ๐ + ๐ ๐ โ1 ๐ฆ ๐ โ1 + โฏ + ๐ 1 ๐ฆ + ๐ 0 . Decoding: evaluate in ๐ฆ = ๐ . Works well if no overflow .
๐ -direction Homomorphic encoding ๐ข -direction How to encode real-world input ๐ ? General principle: find an integer-digit expansion ๐พ = ๐ ๐ + ๐ ๐ + ๐ ๐ + ๐ + ๐ ๐ โ ๐ ๐ ๐ ๐ + ๐ ๐ โ1 ๐ ๐ โ1 + โฏ + ๐ 1 ๐ + ๐ 0 for some base ๐ โ ๐ . Then encode as ๐ ๐ ๐ฆ ๐ + ๐ ๐ โ1 ๐ฆ ๐ โ1 + โฏ + ๐ 1 ๐ฆ + ๐ 0 . Decoding: evaluate in ๐ฆ = ๐ . Works well if no overflow .
๐ -direction Homomorphic encoding ๐ข -direction How to encode real-world input ๐ ? General principle: find an integer-digit expansion ๐พ = ๐ ๐ + ๐ ๐ + ๐ ๐ + ๐ + ๐ ๐ โ ๐ ๐ ๐ ๐ + ๐ ๐ โ1 ๐ ๐ โ1 + โฏ + ๐ 1 ๐ + ๐ 0 for some base ๐ โ ๐ . Then encode as ๐ ๐ ๐ฆ ๐ + ๐ ๐ โ1 ๐ฆ ๐ โ1 + โฏ + ๐ 1 ๐ฆ + ๐ 0 . Decoding: evaluate in ๐ฆ = ๐ . Works well if no overflow .
๐ -direction Homomorphic encoding ๐ข -direction How to encode real-world input ๐ ? General principle: find an integer-digit expansion ๐พ = ๐ ๐ + ๐ ๐ + ๐ ๐ + ๐ + ๐ ๐ โ ๐ ๐ ๐ ๐ + ๐ ๐ โ1 ๐ ๐ โ1 + โฏ + ๐ 1 ๐ + ๐ 0 for some base ๐ โ ๐ . Then encode as ๐ ๐ ๐ฆ ๐ + ๐ ๐ โ1 ๐ฆ ๐ โ1 + โฏ + ๐ 1 ๐ฆ + ๐ 0 . Decoding: evaluate in ๐ฆ = ๐ . Works well if no overflow .
๐ -direction Homomorphic encoding ๐ข -direction How to encode real-world input ๐ ? General principle: find an integer-digit expansion ๐พ = ๐ ๐ + ๐ ๐ + ๐ ๐ + ๐ + ๐ ๐ โ ๐ ๐ ๐ ๐ + ๐ ๐ โ1 ๐ ๐ โ1 + โฏ + ๐ 1 ๐ + ๐ 0 for some base ๐ โ ๐ . Then encode as ๐ ๐ ๐ฆ ๐ + ๐ ๐ โ1 ๐ฆ ๐ โ1 + โฏ + ๐ 1 ๐ฆ + ๐ 0 . Decoding: evaluate in ๐ฆ = ๐ . Works well if no overflow .
Fractional encoding Encoding fractional expansions ๐ โ ๐ ๐ ๐ ๐ + โฏ + ๐ 1 ๐ + ๐ 0 + ๐ โ1 ๐ โ1 + โฏ + ๐ โ๐ก ๐ โ๐ก ? If ๐(๐ฆ) = ๐ฆ ๐ + 1 then ๐ฆ โ๐ โก โ๐ฆ ๐โ๐ , so: [Dowlin et al., โ15] put fractional part at the high powers, with negated sign. ๐พ = ๐ ๐ + ๐ ๐ + ๐ ๐ + ๐ + ๐ + ๐ โ๐ + ๐ โ๐ ๐ข -direction Works as long as high powers ๐ -direction and low powers do not overflow each other.
Fractional encoding Encoding fractional expansions ๐ โ ๐ ๐ ๐ ๐ + โฏ + ๐ 1 ๐ + ๐ 0 + ๐ โ1 ๐ โ1 + โฏ + ๐ โ๐ก ๐ โ๐ก ? If ๐(๐ฆ) = ๐ฆ ๐ + 1 then ๐ฆ โ๐ โก โ๐ฆ ๐โ๐ , so: [Dowlin et al., โ15] put fractional part at the high powers, with negated sign. ๐พ = ๐ ๐ + ๐ ๐ + ๐ ๐ + ๐ + ๐ + ๐ โ๐ + ๐ โ๐ ๐ข -direction Works as long as high powers ๐ -direction and low powers do not overflow each other.
Fractional encoding Encoding fractional expansions ๐ โ ๐ ๐ ๐ ๐ + โฏ + ๐ 1 ๐ + ๐ 0 + ๐ โ1 ๐ โ1 + โฏ + ๐ โ๐ก ๐ โ๐ก ? If ๐(๐ฆ) = ๐ฆ ๐ + 1 then ๐ฆ โ๐ โก โ๐ฆ ๐โ๐ , so: [Dowlin et al., โ15] put fractional part at the high powers, with negated sign. ๐พ = ๐ ๐ + ๐ ๐ + ๐ ๐ + ๐ + ๐ + ๐ โ๐ + ๐ โ๐ ๐ข -direction Works as long as high powers ๐ -direction and low powers do not overflow each other.
SIMD
SIMD
SIMD
SIMD Batch encoding is possible thanks to CRT [Smart- Vercauteren, โ14] : ๐[๐ฆ] ๐[๐ฆ] ๐[๐ฆ] ๐ ๐ฆ โ ๐ ๐ข = (๐ ๐ฆ , ๐ข) ี 1 ๐ฆ , ๐ข) ร 2 ๐ฆ , ๐ข) ร โฏ ร (๐ (๐ ๐ ๐ ๐ฆ , ๐ข where the ๐ ๐ (๐ฆ) are coprime factors of ๐ ๐ฆ modulo ๐ข .
SIMD Batch encoding is possible thanks to CRT [Smart- Vercauteren, โ14] : ๐[๐ฆ] ๐[๐ฆ] ๐[๐ฆ] ๐ ๐ฆ โ ๐ ๐ข = (๐ ๐ฆ , ๐ข) ี 1 ๐ฆ , ๐ข) ร 2 ๐ฆ , ๐ข) ร โฏ ร (๐ (๐ ๐ ๐ ๐ฆ , ๐ข where the ๐ ๐ (๐ฆ) are coprime factors of ๐ ๐ฆ modulo ๐ข .
SIMD Batch encoding is possible thanks to CRT [Smart- Vercauteren, โ14] : ๐[๐ฆ] ๐[๐ฆ] ๐[๐ฆ] ๐ ๐ฆ โ ๐ ๐ข = (๐ ๐ฆ , ๐ข) ี 1 ๐ฆ , ๐ข) ร 2 ๐ฆ , ๐ข) ร โฏ ร (๐ (๐ ๐ ๐ ๐ฆ , ๐ข where the ๐ ๐ (๐ฆ) are coprime factors of ๐ ๐ฆ modulo ๐ข .
SIMD Batch encoding is possible thanks to CRT [Smart- Vercauteren, โ14] : ๐[๐ฆ] ๐[๐ฆ] ๐[๐ฆ] ๐ ๐ฆ โ ๐ ๐ข = (๐ ๐ฆ , ๐ข) ี 1 ๐ฆ , ๐ข) ร 2 ๐ฆ , ๐ข) ร โฏ ร (๐ (๐ ๐ ๐ ๐ฆ , ๐ข where the ๐ ๐ (๐ฆ) are coprime factors of ๐ ๐ฆ modulo ๐ข .
SIMD ๐ท cryp SIMD i Single Instruction, Multiple Data Batch encoding is possible thanks to CRT [Smart- Vercauteren, โ14] : ๐[๐ฆ] ๐[๐ฆ] ๐[๐ฆ] ๐ ๐ฆ โ ๐ ๐ข = (๐ ๐ฆ , ๐ข) ี 1 ๐ฆ , ๐ข) ร 2 ๐ฆ , ๐ข) ร โฏ ร (๐ (๐ ๐ ๐ ๐ฆ , ๐ข where the ๐ ๐ (๐ฆ) are coprime factors of ๐ ๐ฆ modulo ๐ข .
Contributions ๏ SIMD seems incompatible with fractional encoding, because most factors of ๐ฆ ๐ + 1 modulo ๐ข are not of that form. We give a very general fractional encoding method which does not require that ๐ ๐ = ๐ ๐ + ๐ . ๏ The CRT allows for more fine-grained decompositions by also incorporating factorizations of ๐ข . We show that this enables more flexible and denser data packing.
Fractional encoding revisited Write ๐ ๐ฆ = ๐ฆ โ ๐ ๐ฆ + ๐ 0 . First encode ๐ ๐ ๐ ๐ + โฏ + ๐ 1 ๐ + ๐ 0 + ๐ โ1 ๐ โ1 + โฏ + ๐ โ๐ก ๐ โ๐ก as a Laurent polynomial in ๐[๐ฆ ยฑ1 ] by substituting ๐ฆ for ๐ .
Fractional encoding revisited mild requirement: Write ๐ ๐ฆ = ๐ฆ โ ๐ ๐ฆ + ๐ 0 . ๐(๐) invertible mod ๐ First encode ๐ ๐ ๐ฆ ๐ + โฏ + ๐ 1 ๐ฆ + ๐ 0 + ๐ โ1 ๐ฆ โ1 + โฏ + ๐ โ๐ก ๐ฆ โ๐ก as a Laurent polynomial in ๐[๐ฆ ยฑ1 ] by substituting ๐ฆ for ๐ . Then apply: mod ๐ข ๐ ๐ข ๐ฆ ยฑ1 ๐ฆ โฆ ๐ฆ ๐ ๐ ๐ ๐ฆ ยฑ1 ๐ ๐ข where ๐ ๐ : แ ๐ฆ โ1 โฆ โ๐ 0 โ1 ๐(๐ฆ)
Decoding Visually: looks like a mess, ๐ข -direction seems to overflow from the start! ๐ -direction
Decoding Visually: looks like a mess, ๐ข -direction seems to overflow from the start! ๐ -direction
Decoding Visually: looks like a mess, ๐ข -direction seems to overflow from the start! Algebraically, much cleaner. ๐ -direction If ๐ โ โ + 1 = ๐ then the restricted map ๐ ๐ โค๐ ๐ ๐ข ๐ฆ ยฑ1 ๐ ๐ข โฅโ is an isomorphism of free ๐ ๐ข -modules of rank ๐ .
Bounding box Suppose we know that the evaluation of ๐ท when carried out in ๐[๐ฆ ยฑ1 ] ends up in a certain box , and that some shifted plaintext space covers this box . ๐ -axis height ๐ข ๐ โ ๐ฆ -axis width ๐ โ โ + 1 = ๐ โค๐ mod ๐ข ๐ ๐ข ๐ฆ ยฑ1 ๐ ๐ โค๐ ๐ ๐ฆ ยฑ1 ๐ ๐ข . Decoding = inverting โฅโ โฅโ
Decomposing plaintext space The CRT decomposition used in [Smart- Vercauteren, โ14] ๐[๐ฆ] ๐[๐ฆ] ๐[๐ฆ] ๐ ๐ฆ โ ๐ ๐ข = (๐ ๐ฆ , ๐ข) ี 1 ๐ฆ , ๐ข) ร 2 ๐ฆ , ๐ข) ร โฏ ร (๐ (๐ ๐ ๐ ๐ฆ , ๐ข can be viewed as a vertical slicing of plaintext space: Each individual slice should cover the bounding box of the corresponding entry.
Decomposing plaintext space We generalize this discussion: suppose ๐ ๐ ๐ข = ๐ข 1 ๐ข 2 ๐ข 3 โฏ ๐ข ๐ก ๐ ๐ฆ = เท ๐ ๐๐ (๐ฆ) mod ๐ข ๐ and ๐=1 are factorizations into coprimes. Then: ๐[๐ฆ] ๐ ๐ฆ ๐ ๐ข = (๐ ๐ฆ , ๐ข) โ ร ๐ ๐ฆ , ๐ข 1 โฎ ๐ ๐ฆ ร ๐ ๐ฆ , ๐ข ๐ก
Decomposing plaintext space We generalize this discussion: suppose ๐ ๐ ๐ข = ๐ข 1 ๐ข 2 ๐ข 3 โฏ ๐ข ๐ก ๐ ๐ฆ = เท ๐ ๐๐ (๐ฆ) mod ๐ข ๐ and ๐=1 are factorizations into coprimes. Then: ๐[๐ฆ] ๐ ๐ฆ ๐ ๐ฆ ๐ ๐ฆ ๐ ๐ข = (๐ ๐ฆ , ๐ข) โ ร ร โฏ ร ร ๐ 11 ๐ฆ , ๐ข 1 ๐ 12 ๐ฆ , ๐ข 1 ๐ 1๐ 1 ๐ฆ , ๐ข 1 โฎ ๐ ๐ฆ ๐ ๐ฆ ๐ ๐ฆ ร ร ร โฏ ร ๐ ๐ก1 ๐ฆ , ๐ข ๐ก ๐ ๐ก2 ๐ฆ , ๐ข ๐ก ๐ ๐ก๐ ๐ก ๐ฆ , ๐ข ๐ก
Recommend
More recommend