SLIDE 1
Homomorphic SIM 2 D operations: Single Instruction Much More Data - - PowerPoint PPT Presentation
Homomorphic SIM 2 D operations: Single Instruction Much More Data - - PowerPoint PPT Presentation
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
SLIDE 2
SLIDE 3
๐ท
175.2 2๐ฆ1023 + ๐ฆ2 + 7๐ฆ + 5
๐ท
ยงรง{ร #ยฃ*ยฐ|
๐ทcryp
real-world data plaintext ciphertext
Homomorphic encoding
SLIDE 4
๐-direction ๐ข-direction
Typically a ring of the form ๐๐ข = ๐[๐ฆ] (๐ ๐ฆ , ๐ข) where ๐ข โ ๐โฅ2 and ๐ ๐ฆ โ ๐[๐ฆ] is monic irreducible of degree ๐. We represent this by a box: Polynomials of degree < ๐ and coefficients in [0, ๐ข). Plaintext space
๐ ๐ ๐๐ฆ๐
SLIDE 5
How to encode real-world input ๐? ๐ โ ๐๐ ๐๐ + ๐๐ โ1๐๐ โ1 + โฏ + ๐1๐ + ๐0 for some base ๐ โ ๐. Decoding: evaluate in ๐ฆ = ๐. Works well if no overflow. General principle: find an integer-digit expansion Then encode as ๐๐ ๐ฆ๐ + ๐๐ โ1๐ฆ๐ โ1 + โฏ + ๐1๐ฆ + ๐0.
๐-direction ๐ข-direction
Homomorphic encoding
SLIDE 6
General principle: find an integer-digit expansion Then encode as ๐๐ ๐ฆ๐ + ๐๐ โ1๐ฆ๐ โ1 + โฏ + ๐1๐ฆ + ๐0. How to encode real-world input ๐? ๐ โ ๐๐ ๐๐ + ๐๐ โ1๐๐ โ1 + โฏ + ๐1๐ + ๐0 for some base ๐ โ ๐. Decoding: evaluate in ๐ฆ = ๐. Works well if no overflow.
๐-direction ๐ข-direction
๐พ = ๐๐ + ๐๐ + ๐๐ + ๐ + ๐ Homomorphic encoding
SLIDE 7
General principle: find an integer-digit expansion Then encode as ๐๐ ๐ฆ๐ + ๐๐ โ1๐ฆ๐ โ1 + โฏ + ๐1๐ฆ + ๐0. How to encode real-world input ๐? ๐ โ ๐๐ ๐๐ + ๐๐ โ1๐๐ โ1 + โฏ + ๐1๐ + ๐0 for some base ๐ โ ๐. Decoding: evaluate in ๐ฆ = ๐. Works well if no overflow.
๐-direction ๐ข-direction
๐พ = ๐๐ + ๐๐ + ๐๐ + ๐ + ๐ Homomorphic encoding
SLIDE 8
General principle: find an integer-digit expansion Then encode as ๐๐ ๐ฆ๐ + ๐๐ โ1๐ฆ๐ โ1 + โฏ + ๐1๐ฆ + ๐0. How to encode real-world input ๐? ๐ โ ๐๐ ๐๐ + ๐๐ โ1๐๐ โ1 + โฏ + ๐1๐ + ๐0 for some base ๐ โ ๐. Decoding: evaluate in ๐ฆ = ๐. Works well if no overflow.
๐-direction ๐ข-direction
๐พ = ๐๐ + ๐๐ + ๐๐ + ๐ + ๐ Homomorphic encoding
SLIDE 9
General principle: find an integer-digit expansion Then encode as ๐๐ ๐ฆ๐ + ๐๐ โ1๐ฆ๐ โ1 + โฏ + ๐1๐ฆ + ๐0. How to encode real-world input ๐? ๐ โ ๐๐ ๐๐ + ๐๐ โ1๐๐ โ1 + โฏ + ๐1๐ + ๐0 for some base ๐ โ ๐. Decoding: evaluate in ๐ฆ = ๐. Works well if no overflow.
๐-direction ๐ข-direction
๐พ = ๐๐ + ๐๐ + ๐๐ + ๐ + ๐ Homomorphic encoding
SLIDE 10
Encoding fractional expansions ๐ โ ๐๐ ๐๐ + โฏ + ๐1๐ + ๐0 + ๐โ1๐โ1 + โฏ + ๐โ๐ก๐โ๐ก? Works as long as high powers and low powers do not overflow each other.
[Dowlin et al., โ15] If ๐(๐ฆ) = ๐ฆ๐ + 1 then ๐ฆโ๐ โก โ๐ฆ๐โ๐ , so: put fractional part at the high powers, with negated sign.
๐-direction ๐ข-direction
๐พ = ๐๐ + ๐๐ + ๐๐ + ๐ + ๐ + ๐โ๐ + ๐โ๐ Fractional encoding
SLIDE 11
Encoding fractional expansions ๐ โ ๐๐ ๐๐ + โฏ + ๐1๐ + ๐0 + ๐โ1๐โ1 + โฏ + ๐โ๐ก๐โ๐ก? Works as long as high powers and low powers do not overflow each other.
[Dowlin et al., โ15] If ๐(๐ฆ) = ๐ฆ๐ + 1 then ๐ฆโ๐ โก โ๐ฆ๐โ๐ , so: put fractional part at the high powers, with negated sign.
๐-direction ๐ข-direction
๐พ = ๐๐ + ๐๐ + ๐๐ + ๐ + ๐ + ๐โ๐ + ๐โ๐ Fractional encoding
SLIDE 12
Encoding fractional expansions ๐ โ ๐๐ ๐๐ + โฏ + ๐1๐ + ๐0 + ๐โ1๐โ1 + โฏ + ๐โ๐ก๐โ๐ก? Works as long as high powers and low powers do not overflow each other.
[Dowlin et al., โ15] If ๐(๐ฆ) = ๐ฆ๐ + 1 then ๐ฆโ๐ โก โ๐ฆ๐โ๐ , so: put fractional part at the high powers, with negated sign.
๐-direction ๐ข-direction
๐พ = ๐๐ + ๐๐ + ๐๐ + ๐ + ๐ + ๐โ๐ + ๐โ๐ Fractional encoding
SLIDE 13
SIMD
SLIDE 14
SIMD
SLIDE 15
SIMD
SLIDE 16
Batch encoding is possible thanks to CRT [Smart-Vercauteren, โ14]: ๐๐ข = ๐[๐ฆ] (๐ ๐ฆ , ๐ข) ี
โ
๐[๐ฆ] (๐
1 ๐ฆ , ๐ข) ร
๐[๐ฆ] (๐
2 ๐ฆ , ๐ข) ร โฏ ร
๐ ๐ฆ ๐
๐ ๐ฆ , ๐ข
where the ๐
๐(๐ฆ) are coprime factors of ๐ ๐ฆ modulo ๐ข.
SIMD
SLIDE 17
Batch encoding is possible thanks to CRT [Smart-Vercauteren, โ14]: ๐๐ข = ๐[๐ฆ] (๐ ๐ฆ , ๐ข) ี
โ
๐[๐ฆ] (๐
1 ๐ฆ , ๐ข) ร
๐[๐ฆ] (๐
2 ๐ฆ , ๐ข) ร โฏ ร
๐ ๐ฆ ๐
๐ ๐ฆ , ๐ข
where the ๐
๐(๐ฆ) are coprime factors of ๐ ๐ฆ modulo ๐ข.
SIMD
SLIDE 18
Batch encoding is possible thanks to CRT [Smart-Vercauteren, โ14]: ๐๐ข = ๐[๐ฆ] (๐ ๐ฆ , ๐ข) ี
โ
๐[๐ฆ] (๐
1 ๐ฆ , ๐ข) ร
๐[๐ฆ] (๐
2 ๐ฆ , ๐ข) ร โฏ ร
๐ ๐ฆ ๐
๐ ๐ฆ , ๐ข
where the ๐
๐(๐ฆ) are coprime factors of ๐ ๐ฆ modulo ๐ข.
SIMD
SLIDE 19
Batch encoding is possible thanks to CRT [Smart-Vercauteren, โ14]: ๐๐ข = ๐[๐ฆ] (๐ ๐ฆ , ๐ข) ี
โ
๐[๐ฆ] (๐
1 ๐ฆ , ๐ข) ร
๐[๐ฆ] (๐
2 ๐ฆ , ๐ข) ร โฏ ร
๐ ๐ฆ ๐
๐ ๐ฆ , ๐ข
where the ๐
๐(๐ฆ) are coprime factors of ๐ ๐ฆ modulo ๐ข.
SIMD
SLIDE 20
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
SLIDE 21
- SIMD seems incompatible with fractional encoding, because
most factors of ๐ฆ๐ + 1 modulo ๐ข are not of that form.
- The CRT allows for more fine-grained decompositions by also
incorporating factorizations of ๐ข. We give a very general fractional encoding method which does not require that ๐ ๐ = ๐๐ + ๐. We show that this enables more flexible and denser data packing. Contributions
SLIDE 22
Write ๐ ๐ฆ = ๐ฆ โ ๐ ๐ฆ + ๐ 0 . Fractional encoding revisited First encode as a Laurent polynomial in ๐[๐ฆยฑ1] by substituting ๐ฆ for ๐. ๐๐ ๐๐ + โฏ + ๐1๐ + ๐0 + ๐โ1๐โ1 + โฏ + ๐โ๐ก๐โ๐ก
SLIDE 23
๐๐ ๐ฆ๐ + โฏ + ๐1๐ฆ + ๐0 + ๐โ1๐ฆโ1 + โฏ + ๐โ๐ก๐ฆโ๐ก Then apply: ๐ ๐ฆยฑ1
mod ๐ข ๐๐ข ๐ฆยฑ1 ๐๐
๐๐ข where ๐๐: แ ๐ฆ โฆ ๐ฆ ๐ฆโ1 โฆ โ๐ 0 โ1๐(๐ฆ) Write ๐ ๐ฆ = ๐ฆ โ ๐ ๐ฆ + ๐ 0 . Fractional encoding revisited First encode as a Laurent polynomial in ๐[๐ฆยฑ1] by substituting ๐ฆ for ๐. mild requirement: ๐(๐) invertible mod ๐
SLIDE 24
Visually: looks like a mess, seems to overflow from the start! Decoding
๐-direction ๐ข-direction
SLIDE 25
Visually: looks like a mess, seems to overflow from the start! Decoding
๐-direction ๐ข-direction
SLIDE 26
Visually: looks like a mess, seems to overflow from the start! Algebraically, much cleaner. If ๐ โ โ + 1 = ๐ then the restricted map is an isomorphism of free ๐๐ข-modules of rank ๐. Decoding
๐-direction ๐ข-direction
๐๐ข ๐ฆยฑ1
โฅโ โค๐ ๐๐
๐๐ข
SLIDE 27
Suppose we know that the evaluation of ๐ท when carried out in ๐[๐ฆยฑ1] ends up in a certain box
โ ๐ height ๐ข width ๐ โ โ + 1 = ๐
Bounding box ๐ ๐ฆยฑ1
โฅโ โค๐ mod ๐ข ๐๐ข ๐ฆยฑ1 โฅโ โค๐ ๐๐
๐๐ข.
๐ฆ-axis ๐-axis
, and that some shifted plaintext space covers this box. Decoding = inverting
SLIDE 28
The CRT decomposition used in [Smart-Vercauteren, โ14] Decomposing plaintext space ๐๐ข = ๐[๐ฆ] (๐ ๐ฆ , ๐ข) ี
โ
๐[๐ฆ] (๐
1 ๐ฆ , ๐ข) ร
๐[๐ฆ] (๐
2 ๐ฆ , ๐ข) ร โฏ ร
๐ ๐ฆ ๐
๐ ๐ฆ , ๐ข
can be viewed as a vertical slicing of plaintext space: Each individual slice should cover the bounding box of the corresponding entry.
SLIDE 29
We generalize this discussion: suppose Decomposing plaintext space ๐๐ข = ๐[๐ฆ] (๐ ๐ฆ , ๐ข) โ ๐ข = ๐ข1๐ข2๐ข3 โฏ ๐ข๐ก ๐ ๐ฆ = เท
๐=1 ๐ ๐
๐
๐๐(๐ฆ) mod ๐ข๐
and are factorizations into coprimes. Then: ๐ ๐ฆ ๐ ๐ฆ , ๐ข1 ร ร ๐ ๐ฆ ๐ ๐ฆ , ๐ข๐ก โฎ
SLIDE 30
๐ ๐ฆ ๐
11 ๐ฆ , ๐ข1
ร ๐ ๐ฆ ๐
12 ๐ฆ , ๐ข1
ร โฏ ร ๐ ๐ฆ ๐
1๐ 1 ๐ฆ , ๐ข1
ร ร ๐ ๐ฆ ๐
๐ก1 ๐ฆ , ๐ข๐ก
ร ๐ ๐ฆ ๐
๐ก2 ๐ฆ , ๐ข๐ก
ร โฏ ร ๐ ๐ฆ ๐
๐ก๐ ๐ก ๐ฆ , ๐ข๐ก
โฎ We generalize this discussion: suppose Decomposing plaintext space ๐๐ข = ๐[๐ฆ] (๐ ๐ฆ , ๐ข) โ ๐ข = ๐ข1๐ข2๐ข3 โฏ ๐ข๐ก ๐ ๐ฆ = เท
๐=1 ๐ ๐
๐
๐๐(๐ฆ) mod ๐ข๐
and are factorizations into coprimes. Then:
SLIDE 31
Decomposing plaintext space
๐ข1 ๐ข2 ๐ข3 ๐ข4
SLIDE 32
Blocks What if a computation does not fit into one of these bricks?
SLIDE 33
Blocks What if a computation does not fit into one of these bricks? Distribute computation over enough horizontal slices.
SLIDE 34
Blocks What if a computation does not fit into one of these bricks? Distribute computation over enough horizontal slices. In each horizontal slice, select enough factors ๐
๐๐(๐ฆ).
Gives rise to notion of block: แซ
๐โ๐ฝ
แซ
๐โ๐พ๐
๐ข๐, ๐
๐๐ ๐ฆ
SLIDE 35
Toolkit for optimal packing Choose good ๐ข for given circuit ๐ท and dataset, taking into account:
- lower bounds coming from correct decoding,
- upper bound coming from correct decryption,
- splitting behaviour:
similar-sized ๐ขโs give very different brick structures.
SLIDE 36
Toolkit for optimal packing Choose set of blocks that make the best fit for the computation.
SLIDE 37
Toolkit for optimal packing Choose appropriate encoding base ๐, can be specific to block.
SLIDE 38
Toolkit for optimal packing Choose appropriate encoding base ๐, can be specific to block.
SLIDE 39
Toolkit for optimal packing Choose appropriate encoding base ๐, can be specific to block. Smaller base gives wider but lower encodings.
SLIDE 40