Homomorphic SIM 2 D operations: Single Instruction Much More Data - - PowerPoint PPT Presentation

โ–ถ
homomorphic sim 2 d operations
SMART_READER_LITE
LIVE PREVIEW

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-1
SLIDE 1

Homomorphic SIM2D operations: Single Instruction Much More Data

Wouter Castryck Ilia Iliashenko Frederik Vercauteren

slide-2
SLIDE 2

๐ท ๐ทcryp

ยงรง{ร #ยฃ*ยฐ| 175.2

Homomorphic encryption

slide-3
SLIDE 3

๐ท

175.2 2๐‘ฆ1023 + ๐‘ฆ2 + 7๐‘ฆ + 5

๐ท

ยงรง{ร #ยฃ*ยฐ|

๐ทcryp

real-world data plaintext ciphertext

Homomorphic encoding

slide-4
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
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
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
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
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
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
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
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
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
SLIDE 13

SIMD

slide-14
SLIDE 14

SIMD

slide-15
SLIDE 15

SIMD

slide-16
SLIDE 16

Batch encoding is possible thanks to CRT [Smart-Vercauteren, โ€˜14]: ๐‘†๐‘ข = ๐š[๐‘ฆ] (๐‘” ๐‘ฆ , ๐‘ข) ีœ

โ‰…

๐š[๐‘ฆ] (๐‘”

1 ๐‘ฆ , ๐‘ข) ร—

๐š[๐‘ฆ] (๐‘”

2 ๐‘ฆ , ๐‘ข) ร— โ‹ฏ ร—

๐š ๐‘ฆ ๐‘”

๐‘  ๐‘ฆ , ๐‘ข

where the ๐‘”

๐‘—(๐‘ฆ) are coprime factors of ๐‘” ๐‘ฆ modulo ๐‘ข.

SIMD

slide-17
SLIDE 17

Batch encoding is possible thanks to CRT [Smart-Vercauteren, โ€˜14]: ๐‘†๐‘ข = ๐š[๐‘ฆ] (๐‘” ๐‘ฆ , ๐‘ข) ีœ

โ‰…

๐š[๐‘ฆ] (๐‘”

1 ๐‘ฆ , ๐‘ข) ร—

๐š[๐‘ฆ] (๐‘”

2 ๐‘ฆ , ๐‘ข) ร— โ‹ฏ ร—

๐š ๐‘ฆ ๐‘”

๐‘  ๐‘ฆ , ๐‘ข

where the ๐‘”

๐‘—(๐‘ฆ) are coprime factors of ๐‘” ๐‘ฆ modulo ๐‘ข.

SIMD

slide-18
SLIDE 18

Batch encoding is possible thanks to CRT [Smart-Vercauteren, โ€˜14]: ๐‘†๐‘ข = ๐š[๐‘ฆ] (๐‘” ๐‘ฆ , ๐‘ข) ีœ

โ‰…

๐š[๐‘ฆ] (๐‘”

1 ๐‘ฆ , ๐‘ข) ร—

๐š[๐‘ฆ] (๐‘”

2 ๐‘ฆ , ๐‘ข) ร— โ‹ฏ ร—

๐š ๐‘ฆ ๐‘”

๐‘  ๐‘ฆ , ๐‘ข

where the ๐‘”

๐‘—(๐‘ฆ) are coprime factors of ๐‘” ๐‘ฆ modulo ๐‘ข.

SIMD

slide-19
SLIDE 19

Batch encoding is possible thanks to CRT [Smart-Vercauteren, โ€˜14]: ๐‘†๐‘ข = ๐š[๐‘ฆ] (๐‘” ๐‘ฆ , ๐‘ข) ีœ

โ‰…

๐š[๐‘ฆ] (๐‘”

1 ๐‘ฆ , ๐‘ข) ร—

๐š[๐‘ฆ] (๐‘”

2 ๐‘ฆ , ๐‘ข) ร— โ‹ฏ ร—

๐š ๐‘ฆ ๐‘”

๐‘  ๐‘ฆ , ๐‘ข

where the ๐‘”

๐‘—(๐‘ฆ) are coprime factors of ๐‘” ๐‘ฆ modulo ๐‘ข.

SIMD

slide-20
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
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
SLIDE 22

Write ๐‘” ๐‘ฆ = ๐‘ฆ โ‹… ๐‘• ๐‘ฆ + ๐‘” 0 . Fractional encoding revisited First encode as a Laurent polynomial in ๐š[๐‘ฆยฑ1] by substituting ๐‘ฆ for ๐‘. ๐‘๐‘ ๐‘๐‘  + โ‹ฏ + ๐‘1๐‘ + ๐‘0 + ๐‘โˆ’1๐‘โˆ’1 + โ‹ฏ + ๐‘โˆ’๐‘ก๐‘โˆ’๐‘ก

slide-23
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
SLIDE 24

Visually: looks like a mess, seems to overflow from the start! Decoding

๐‘’-direction ๐‘ข-direction

slide-25
SLIDE 25

Visually: looks like a mess, seems to overflow from the start! Decoding

๐‘’-direction ๐‘ข-direction

slide-26
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
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
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
SLIDE 29

We generalize this discussion: suppose Decomposing plaintext space ๐‘†๐‘ข = ๐š[๐‘ฆ] (๐‘” ๐‘ฆ , ๐‘ข) โ‰… ๐‘ข = ๐‘ข1๐‘ข2๐‘ข3 โ‹ฏ ๐‘ข๐‘ก ๐‘” ๐‘ฆ = เท‘

๐‘—=1 ๐‘ ๐‘—

๐‘”

๐‘—๐‘˜(๐‘ฆ) mod ๐‘ข๐‘—

and are factorizations into coprimes. Then: ๐š ๐‘ฆ ๐‘” ๐‘ฆ , ๐‘ข1 ร— ร— ๐š ๐‘ฆ ๐‘” ๐‘ฆ , ๐‘ข๐‘ก โ‹ฎ

slide-30
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
SLIDE 31

Decomposing plaintext space

๐‘ข1 ๐‘ข2 ๐‘ข3 ๐‘ข4

slide-32
SLIDE 32

Blocks What if a computation does not fit into one of these bricks?

slide-33
SLIDE 33

Blocks What if a computation does not fit into one of these bricks? Distribute computation over enough horizontal slices.

slide-34
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
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
SLIDE 36

Toolkit for optimal packing Choose set of blocks that make the best fit for the computation.

slide-37
SLIDE 37

Toolkit for optimal packing Choose appropriate encoding base ๐‘, can be specific to block.

slide-38
SLIDE 38

Toolkit for optimal packing Choose appropriate encoding base ๐‘, can be specific to block.

slide-39
SLIDE 39

Toolkit for optimal packing Choose appropriate encoding base ๐‘, can be specific to block. Smaller base gives wider but lower encodings.

slide-40
SLIDE 40

Thank you! Questions?