$30 off During Our Annual Pro Sale. View Details »

準同型暗号処理で多用されるTrace-Type FunctionのAVX512による高速化

準同型暗号処理で多用されるTrace-Type FunctionのAVX512による高速化

DEIM Forum 2022 J41-4にて発表。

Kotaro Inoue

March 02, 2022
Tweet

More Decks by Kotaro Inoue

Other Decks in Science

Transcript

  1. 準同型暗号処理で多用される
    Trace-Type FunctionのAVX512による高速化
    2022年3月2日
    DEIM2022 J41-4
    早稲田大学
    井上 紘太朗,鈴木 拓也,山名 早人

    View Slide

  2. クラウドコンピューティングの普及
    • 手軽に高性能な計算資源にアクセスできる
    • データ利活用(機械学習等)の盛り上がり
    2
    1. 研究背景

    View Slide

  3. クラウドコンピューティングの問題点
    • 情報漏えいによるプライバシー侵害リスク
    →データを安全に利活用する技術が注目
    3
    1. 研究背景

    View Slide

  4. 準同型暗号
    Homomorphic Encryption (HE)
    • データを暗号化したまま計算できる暗号技術
    • 平文における加算・乗算 → それぞれ準同型加算・準同型乗算に対応
    4
    1. 研究背景
    秘密鍵
    公開鍵
    Client-side
    暗号化
    134
    251
    385
    134
    251
    復号
    385
    Server-side
    134 251
    +
    385
    演算

    View Slide

  5. 準同型暗号が抱える課題
    • 時間・空間計算量がともに膨大
    • 準同型加算
    →通常の加算と比較・・・ 168 倍 [6]
    • 準同型乗算
    →通常の乗算と比較・・・ 27,721 倍 [6]
    [6] Wonkyung Jung, Eojin Lee, Sangpyo Kim, Jongmin Kim, Namhoon Kim, Keewoo Lee, Chohong Min, Jung Hee Cheon, and Jung Ho Ahn. Accelerating fully homomorphic encryption through architecture- centric
    analysis and optimization. IEEE Access, Vol. 9, pp. 98772–98789, 2021.
    5
    1. 研究背景

    View Slide

  6. パッキング[3][4]
    6
    1. 研究背景
    1 2 3 4
    5 6 7 8
    1
    2
    3
    4
    5
    6
    7
    8
    6
    8
    10
    12 6 8 10 12
    スロット
    • SIMDの要領
    • 複数の値に対し,演算を並列に実行
    [3] Jung Hee Cheon, Andrey Kim, Miran Kim, and Yongsoo Song. Homomorphic encryption for arithmetic of approximate numbers. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), Vol. 10624 LNCS, pp. 409–437. Springer Verlag, 2017.
    [4] N P Smart and F Vercauteren. Fully homomorphic SIMD operations. Designs, Codes and Cryptography, Vol. 71, No. 1, pp. 57–81, 2014.

    View Slide

  7. Rotation
    • スロットのシフト
    • 準同型乗算と比較
    → 7.15~8.88 倍の実行時間[7]
    7
    1. 研究背景
    [7] Fabian Boemer, Rosario Cammarota, Daniel Demmler, Thomas Schneider, and Hossein Yalame. Mp2ml: A mixed-protocol machine learning framework for private inference. Cryptology ePrint Archive, Report
    2020/721, 2020. https://ia.cr/2020/721.

    View Slide

  8. Trace-Type Function
    • rotation & 準同型加算(rotate-and-sum)を再帰的に
    適用する形をした関数の総称
    例) スロットの総和(total-sums)
    • 暗号文の次数を𝑁
    → 𝒪 log 𝑁 回のrotationを含む
    →準同型乗算比 85.83~124.26 倍の実行時間[7]
    8
    1. 研究背景
    1 2 3 4
    2 3 4 1
    3 4 1 2
    4 1 2 3
    10 10 10 10
    準同型暗号実用化に向けての大きな障害
    [7] Fabian Boemer, Rosario Cammarota, Daniel Demmler, Thomas Schneider, and Hossein Yalame. Mp2ml: A mixed-protocol machine learning framework for private inference. Cryptology ePrint Archive, Report 2020/721, 2020. https://ia.cr/2020/721.

    View Slide

  9. 準同型暗号の性能向上へ向けた試み
    9
    1. 研究背景
    • 理論面
    •実装面
    本研究のアプローチはこちら

    View Slide

  10. 実装面での性能向上の試み
    並列実行可能な箇所をハードウェア支援により並列実行
    • CPU(Central Processing Unit)のSIMD拡張命令セットの活用
    例) Intel AVX512(Advanced Vector eXtensions)
    → SIMDレジスタ長512bit(64bit整数 x 8)
    • GPU(Graphic Processing Unit)やFPGA(Field Programmable Gate Array)といったハードウェアへのオフロード
    10
    1. 研究背景

    View Slide

  11. 本研究のゴール
    「Trace-Type Function」について
    「既存の高速化手法」+「 AVX512」による
    更なる高速化の実現
    11
    1. 研究背景

    View Slide

  12. AVX512を用いた準同型暗号の高速化
    • Jungら[6](2021年)
    AVX512を用いて準同型乗算を実装
    → 従来実装(HEAAN)比 ,2.06倍 の計算速度向上
    • Boemerら[8](2021年)
    AVX512-IFMA52(Integer Fused Multiply Add)を用いて以下の演算を実装
    - NTT / invNTT
    - ベクトル同士の剰余演算
    → 従来実装(PALISADE)比, 2.59倍 の計算速度向上
    12
    2. 関連研究
    [6] Wonkyung Jung, Eojin Lee, Sangpyo Kim, Jongmin Kim, Namhoon Kim, Keewoo Lee, Chohong Min, Jung Hee Cheon, and Jung Ho Ahn. Accelerating fully homomorphic encryption through architecture- centric analysis and optimization. IEEE
    Access, Vol. 9, pp. 98772–98789, 2021.
    [8] Fabian Boemer, Sejun Kim, Gelila Seifu, Fillipe de Souza, and Vinodh Gopal. Intel HEXL: Accelerating Homomorphic Encryption with Intel AVX512-IFMA52. In Proceedings of the 9th on Workshop on Encrypted Computing & Applied
    Homomorphic Cryptography, WAHC ’21, pp. 57–62, New York, NY, USA, 2021. Association for Computing Machinery.
    NTT(数論変換)
    多項式の次数Nとする.
    本来𝒪 𝑁2 である多項式同士の
    畳み込みを𝒪 𝑁 log 𝑁 で行う手法.
    invNTTはNTTの逆演算である.
    𝑎 ⋅ 𝑏 + 𝑐

    View Slide

  13. Trace-Type Functionの高速化
    • Haleviら[19](2014年)
    total-sumsをrotate-and-sumの再帰的適用により初めて構成
    • Halevi ら [24] (2018年)
    baby-step/giant-step(BS/GS) によるrotationの適用回数削減
    + 事前計算&処理順序入れ替えによりrotation自体の実行コスト削減
    • Bossuat ら [25] (2021年)
    [24]を改良,鍵生成時の事前計算によりrotation自体の実行コストをさらに削減
    • Ishimakiら[5](2021年)
    [19][24][25]に加え,loop-unrollingを適用(Unrolled Trace-Type Function)
    → ベースライン[19]比 1.32〜2.12倍 の性能向上
    13
    2. 関連研究
    [5] Yu Ishimaki and Hayato Yamana. Faster Homomorphic Trace-Type Function Evaluation. IEEE Access, Vol. 9, pp. 53061–53077, 2021.
    [19] Shai Halevi and Victor Shoup. Algorithms in HElib. In A. Garay, Juan and Rosario Gennaro, edi- tors, Advances in Cryptology – CRYPTO 2014, pp. 554–571, Berlin, Heidelberg, 2014. Springer Berlin Heidelberg.
    [24] Shai Halevi and Victor Shoup. Faster Homomorphic Linear Transformations in HElib. In Hovav Shacham and Alexandra Boldyreva, editors, Advances in Cryptology – CRYPTO 2018, pp. 93–120, Cham, 2018.
    Springer International Publishing.
    [25] Bossuat Jean-Philippe, Christian Mouchet, Troncoso-Pastoriza Juan, and Hubaux Jean-Pierre. Efficient Bootstrapping for Approximate Homomorphic Encryption with Non-sparse Keys. In Canteaut Anne and
    Fran ̧cois-Xavier Standaert, editors, Advances in Cryptology – EUROCRYPT 2021, pp. 587–617, Cham, 2021. Springer International Publishing.

    View Slide

  14. 14
    Unrolled Trace-Type Functionの概要図
    2. 関連研究
    𝑖 ← 0, c′ ← 𝑐
    𝑖 < 𝑀
    𝑖 ← 𝑖 + 1
    𝑐′′ ← 𝑟𝑜𝑡𝑎𝑡𝑒(𝑐′)
    𝑐′ ← 𝑐′ ⊕ 𝑐′′
    𝑐: 暗号文,
    𝑀: rotate-and-sumの実行回数
    true
    false
    𝑐′
    𝑖 ← 0, c′ ← 𝑐
    𝑖 < ℎ
    𝑖 ← 𝑖 + 1
    𝑐′′ ← 𝑢𝑛𝑟𝑜𝑙𝑙𝑒𝑑𝑟𝑜𝑡𝑎𝑡𝑒(𝑐′)
    𝑐′ ← 𝑐′ ⊕ 𝑐′′
    𝑐: 暗号文,
    ℎ: unroll後のイテレーション数
    true
    false
    𝑐′
    ベースライン[19] Unrolled[5]
    [5] Yu Ishimaki and Hayato Yamana. Faster Homomorphic Trace-Type Function Evaluation. IEEE Access, Vol. 9, pp. 53061–53077, 2021.
    [19] Shai Halevi and Victor Shoup. Algorithms in HElib. In A. Garay, Juan and Rosario Gennaro, edi- tors, Advances in Cryptology – CRYPTO 2014, pp. 554–571, Berlin, Heidelberg, 2014. Springer Berlin Heidelberg.

    View Slide

  15. Unrolled Trace-Type Functionの計算量
    2. 関連研究
    15
    ベースライン[19] Unrolled[5]
    𝒪 log 𝑁 のrotationと準同型加算 𝒪 ℎℎ 𝑁 のrotationと準同型加算
    [5] Yu Ishimaki and Hayato Yamana. Faster Homomorphic Trace-Type Function Evaluation. IEEE Access, Vol. 9, pp. 53061–53077, 2021.
    [19] Shai Halevi and Victor Shoup. Algorithms in HElib. In A. Garay, Juan and Rosario Gennaro, edi- tors, Advances in Cryptology – CRYPTO 2014, pp. 554–571, Berlin, Heidelberg, 2014. Springer Berlin Heidelberg.

    View Slide

  16. 提案手法の概要
    (1)AVX512を用いたベクトル同士の融合積和演算の実装
    (2)Unrolled Trace-Type FunctionへのAVX512適用
    16
    3. 提案手法

    View Slide

  17. (1) ベクトル同士の融合積和演算
    • Intel HEXL[8]
    → 本研究で用いたAVX512を利用するための補助ライブラリ
    - ベクトル対スカラの剰余演算(加算,減算,乗算)
    - ベクトル対ベクトルの剰余演算(加算,減算,乗算,融合積和)
    17
    3. 提案手法
    [8] Fabian Boemer, Sejun Kim, Gelila Seifu, Fillipe de Souza, and Vinodh Gopal. Intel HEXL: Accelerating Homomorphic Encryption with Intel AVX512-IFMA52. In Proceedings of the 9th on Workshop on Encrypted Computing & Applied
    Homomorphic Cryptography, WAHC ’21, pp. 57–62, New York, NY, USA, 2021. Association for Computing Machinery.
    ベクトル対ベクトルの融合積和の実装が存在しない
    𝑎 ⋅ 𝑏 + 𝑐

    View Slide

  18. (1) ベクトル同士の融合積和演算(概念図)
    以下の方針で,新たにベクトル同士の融合積和演算を実装
    • 別々の関数として実装されているものを一つの関数に集約
    • 各関数出力時のmod演算を一つに集約
    18
    3. 提案手法
    EltwiseMultMod: 剰余乗算
    要素ごとのmod
    要素ごとの乗算
    EltwiseAddMod: 剰余加算
    要素ごとのmod
    要素ごとの加算
    EltwiseFMAMod (新たに実装)
    要素ごとの乗算
    要素ごとのmod
    要素ごとの加算

    View Slide

  19. (2) Unrolled Trace-Type Function に対する
    AVX512 の適用
    • 準同型暗号実装の一つであるPALISADEv1.9.2[15]にAVX512を適用
    • 以下の演算の内部実装をAVX512を使用したものへ置き換え
    • NTT / invNTT
    • 剰余演算(加算・減算・乗算・融合積和)
    • AVX512を適用したPALISADEv1.9.2を利用して
    Unrolled Trace-Type Functionの実装を行った.
    19
    3. 提案手法
    [15] PALISADE Lattice Cryptography Library (release 1.9.2). https://palisade-crypto.org/, 4 2020.
    NTT(数論変換)
    多項式の次数Nとする.
    本来𝒪 𝑁2 である多項式同
    士の畳み込みを𝒪 𝑁 log 𝑁 で
    行う手法.
    invNTTはNTTの逆演算である.

    View Slide

  20. 実験環境
    • Turbo BoostとHyper-Threadingは無効化済み
    • 1CPUおよびCPUに隣接したRAM(NUMA1ノード)を使用するよう指定
    • 動作周波数は定格に固定
    20
    4. 評価実験

    View Slide

  21. (1) ベクトル同士の融合積和演算
    • 以下2パターンについて実行,結果を比較
    • MultAdd:
    Intel HEXLに実装されている剰余乗算および剰余加算の関数を順次呼び出す
    • FMA:
    新しく実装した融合積和演算を呼び出す
    21
    4. 評価実験

    View Slide

  22. • 入力(入力データサイズ: 64 ⋅ (3 ⋅ 𝑁 ⋅ 𝑙 + 𝑙)/8 [bytes])
    • 暗号文を模した𝑙組の𝑁要素64bit整数一次元配列 x 3
    • 暗号文の法を模した𝑙要素64bit整数一次元配列 x 1
    • 出力
    • 𝑙組の𝑁要素64bit整数一次元配列 x 1
    (1) ベクトル同士の融合積和演算
    22
    4. 評価実験
    9 ⋯ 1
    ⋱ ⋱ ⋱
    3 ⋯ 7
    𝑙
    𝑁
    2 ⋯ 5
    ⋱ ⋱ ⋱
    8 ⋯ 4
    6 ⋯ 8
    ⋱ ⋱ ⋱
    1 ⋯ 2
    13

    9
    𝑙
    11 ⋯ 0
    ⋱ ⋱ ⋱
    7 ⋯ 3
    𝑙
    𝑁

    View Slide

  23. (1) ベクトル同士の融合積和演算
    23
    4. 評価実験
    [27] Martin Albrecht, Melissa Chase, Hao Chen, Jintai Ding, Shafi Goldwasser, Sergey Gorbunov, Shai Halevi, Jeffrey Hoffstein, Kim Laine, Kristin Lauter, Satya Lokam, Daniele Micciancio, Dustin Moody, Travis Morrison, Amit Sahai, and Vinod Vaikuntanathan. Homomorphic encryption standard. Cryptology ePrint Archive, Report 2019/939, 2019. https://ia.cr/2019/939.
    入力データサイズごとの平均実行時間
    𝟐𝟐𝟎[bytes]付近で逆転
    ○ 220[bytes]付近より小さい場合
    → MultAddが優勢
    → 内部パスの手動アンローリング
    → L2キャッシュを有効に利用
    ○ 220[bytes]付近より大きい場合
    → FMAが優勢
    → L3キャッシュのレイテンシ影響
    L1キャッシュ L2キャッシュ
    logN = 12
    l = 2
    logN = 13
    l = 5
    logN = 14
    l = 10
    logN = 15
    l = 15
    128-bit security[27]での𝒍の目安値
    𝑙 = (log 𝑞 − 60)/Δ + 1
    ただし,scaling factorΔ = 40[bit]

    View Slide

  24. (2) Unrolled Trace-Type Function に
    対するAVX512 の適用(スレッド数1)
    24
    4. 評価実験
    Loop-unrolling後のイテレーション数hごとの実行時間の高速化率
    (rotate-and-sumの実行回数𝑀 = 7)
    𝒍が増加すると高速化率も増加
    𝑙の増加 = 暗号文のデータサイズ増加
    → SIMDにより一度に処理されるデータ増加
    𝒌, 𝒉が増加すると高速化率は低下
    𝑘, ℎの増加 = Trace-Type Functionの計算量増加
    → SIMDで処理されるデータ量…変化なし
    → 全体として高速化率は低下
    線種が同一:M,k固定
    マーカー種が同一:M,l固定
    k,l: 準同型暗号のパラメータ
    Loop-unrolling後のイテレーション数
    l = 9
    l = 4
    l = 1

    View Slide

  25. (2) Unrolled Trace-Type Function に
    対するAVX512 の適用(スレッド数1)
    25
    4. 評価実験
    Loop-unrolling後のイテレーション数hごとの実行時間の高速化率
    (rotate-and-sumの実行回数𝑀 = 7)
    𝒍が増加すると高速化率も増加
    𝑙の増加 = 暗号文のデータサイズ増加
    → SIMDにより一度に処理されるデータ増加
    𝒌, 𝒉が増加すると高速化率は低下
    𝑘, ℎの増加 = Trace-Type Functionの計算量増加
    → SIMDで処理されるデータ量…変化なし
    → 全体として高速化率は低下
    線種が同一:M,k固定
    マーカー種が同一:M,l固定
    Loop-unrolling後のイテレーション数
    k = 1
    k = 5
    k = 10
    k,l: 準同型暗号のパラメータ

    View Slide

  26. (2) Unrolled Trace-Type Function に
    対するAVX512 の適用(スレッド数8)
    26
    4. 評価実験
    Loop-unrolling後のイテレーション数hごとの実行時間の高速化率
    (rotate-and-sumの実行回数𝑀 = 7)
    𝒌, 𝒉が増加すると高速化率は低下
    𝑘, ℎの増加 = Trace-Type Functionの計算量増加
    → SIMDで処理されるデータ量…変化なし
    → 全体として高速化率は低下
    全体的に高速化率が一定
    スレッド間の同期コストの影響
    線種が同一:M,k固定
    マーカー種が同一:M,l固定
    k,l: 準同型暗号のパラメータ
    Loop-unrolling後のイテレーション数
    k = 1
    k = 5
    k = 10

    View Slide

  27. Unrolled Trace-Type Function に対する
    AVX512 の適用(スレッド数1)
    27
    4. 評価実験
    実行時間を箱ひげ図としてプロットしたもの
    (rotate-and-sumの実行回数𝑀 = 7,準同型暗号のパラメータ𝑘 = 1, 𝑙 = 1 ,
    loop-unrolling後のイテレーション数h )

    View Slide

  28. Unrolled Trace-Type Function に対する
    AVX512 の適用(スレッド数8)
    28
    4. 評価実験
    実行時間を箱ひげ図としてプロットしたもの
    (rotate-and-sumの実行回数𝑀 = 7,準同型暗号のパラメータ𝑘 = 1, 𝑙 = 1 ,
    loop-unrolling後のイテレーション数h )

    View Slide

  29. まとめ
    • 準同型暗号におけるTrace-Type Functionの更なる高速化を
    loop-unrollingと AVX512の組み合わせにより試みた.
    • (付随して)ベクトル同士の融合積和演算の実装を新たに行なった.
    • loop-unrolling(Ishimakiら[5])のみを適用した場合と比較し,
    提案手法により1.05-2.30倍の計算速度向上を達成した.
    今後の展望
    • より実運用を想定した検証の必要性
    • 実際にtrace-type functionを活用したアプリケーションに適用した上での評価
    • 本実験で無効化したTurbo BoostやHyper-Threadingを有効化した上での検証
    29
    [5] Yu Ishimaki and Hayato Yamana. Faster Homomorphic Trace-Type Function Evaluation. IEEE Access, Vol. 9, pp. 53061–53077, 2021.
    ご清聴ありがとうございました

    View Slide

  30. 参考文献 (i)
    [1] International Data Corporation (IDC). Data creation and replication will grow at a faster rate than installed storage capacity, according to the idc global datasphere and storagesphere forecasts. https:
    //www.idc.com/getdoc.jsp?containerId=prUS47560321, 3 2021. (Accessed on 01/06/2022).
    [2] Craig Gentry. Fully Homomorphic Encryption Using Ideal Lattices. In Proceedings of the Forty-First Annual ACM Symposium on Theory of Computing, STOC ’09, pp. 169–178, New York, NY, USA, 2009. Association for Computing Machinery.
    [3] Jung Hee Cheon, Andrey Kim, Miran Kim, and Yongsoo Song. Homomorphic encryption for arithmetic of approximate numbers. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture
    Notes in Bioinformatics), Vol. 10624 LNCS, pp. 409–437. Springer Verlag, 2017.
    [4] N P Smart and F Vercauteren. Fully homomorphic SIMD operations. Designs, Codes and Cryptography, Vol. 71, No. 1, pp. 57–81, 2014.
    [5] Yu Ishimaki and Hayato Yamana. Faster Homomorphic Trace-Type Function Evaluation. IEEE Access, Vol. 9, pp. 53061–53077, 2021.
    [6] Wonkyung Jung, Eojin Lee, Sangpyo Kim, Jongmin Kim, Namhoon Kim, Keewoo Lee, Chohong Min, Jung Hee Cheon, and Jung Ho Ahn. Accelerating fully homomorphic encryption through architecture- centric analysis and optimization.
    IEEE Access, Vol. 9, pp. 98772–98789, 2021.
    [7] Fabian Boemer, Rosario Cammarota, Daniel Demmler, Thomas Schneider, and Hossein Yalame. Mp2ml: A mixed-protocol machine learning framework for private inference. Cryptology ePrint Archive, Report 2020/721, 2020.
    https://ia.cr/2020/721.
    [8] Fabian Boemer, Sejun Kim, Gelila Seifu, Fillipe de Souza, and Vinodh Gopal. Intel HEXL: Accelerating Homomorphic Encryption with Intel AVX512-IFMA52. In Proceedings of the 9th on Workshop on Encrypted Computing & Applied
    Homomorphic Cryptography, WAHC ’21, pp. 57–62, New York, NY, USA, 2021. Association for Computing Machinery.
    [9] Jung Hee Cheon, Kyoohyung Han, Andrey Kim, Miran Kim, and Yongsoo Song. A Full RNS Variant of Approximate Homomorphic Encryption. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence
    and Lecture Notes in Bioinformatics), Vol. 11349 LNCS, pp. 347–368. Springer Verlag, 2019.
    [10] Junfeng Fan and Frederik Vercauteren. Somewhat practical fully homomorphic encryption. Cryptology ePrint Archive, Report 2012/144, 2012. https://ia.cr/2012/144.
    [11] Zvika Brakerski. Fully homomorphic encryption without modulus switching from classical GapSVP. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics),
    2012.
    [12] Zvika Brakerski, Craig Gentry, and Vinod Vaikuntanathan. (Leveled) Fully Homomorphic Encryption without Bootstrapping. ACM Transactions on Computation Theory, 2014.
    30

    View Slide

  31. 参考文献 (ii)
    [13] Ilaria Chillotti, Nicolas Gama, Mariya Georgieva, and Malika Izabach`ene. Faster fully homomorphic encryption: Bootstrapping in less than 0.1 seconds. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial
    Intelligence and Lecture Notes in Bioinformatics), Vol. 10031 LNCS, pp. 3–33. Springer Verlag, 2016.
    [14] P V Ananda Mohan. Residue Number Systems. Springer International Publishing, 2016.
    [15] PALISADE Lattice Cryptography Library (release 1.9.2). https://palisade-crypto.org/, 4 2020.
    [16] Jean Claude Bajard, Julien Eynard, M. Anwar Hasan, and Vincent Zucca. A Full RNS Variant of FV Like Somewhat Homomorphic Encryption Schemes. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial
    Intelligence and Lecture Notes in Bioinformatics), Vol. 10532 LNCS, pp. 423–442. Springer Verlag, 2017.
    [17] Kyoohyung Han and Dohyeong Ki. Better bootstrapping for approximate homomorphic encryption. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics),
    Vol. 12006 LNCS, pp. 364–390. Springer, 2020.
    [18] Gentry Craig, Shai Halevi, and Smart Nigel P. Fully Homomorphic Encryption with Polylog Overhead. In Pointcheval David and Thomas Johansson, editors, Advances in Cryptology – EUROCRYPT 2012, pp. 465–482, Berlin, Heidelberg,
    2012. Springer Berlin Heidelberg.
    [19] Shai Halevi and Victor Shoup. Algorithms in HElib. In A. Garay, Juan and Rosario Gennaro, edi- tors, Advances in Cryptology – CRYPTO 2014, pp. 554–571, Berlin, Heidelberg, 2014. Springer Berlin Heidelberg.
    [20] Craig Gentry, Shai Halevi, Charanjit Jutla, and Mariana Raykova. Private Database Access with HE- over-ORAM Architecture. In Malkin Tal, Vladimir Kolesnikov, and Lewko Allison BishopPolychronakis Michalis, editors, Applied
    Cryptography and Network Security, pp. 172–191, Cham, 2015. Springer Inter- national Publishing.
    [21] Ahmad Al Badawi, Louie Hoang, Chan Fook Mun, Kim Laine, and Khin Mi Mi Aung. PrivFT: Private and Fast Text Classification With Homomorphic Encryption. IEEE Access, Vol. 8, pp. 226544–226556, 12 2020.
    [22] Intel Corporation. Intel ® intrinsics guide. https://www.intel.com/content/www/us/en/docs/ intrinsics-guide/index.html. (Accessed on 01/22/2022).
    [23] Aguilar-Melchor Carlos, Jorisand Guelton Serge Barrier, Guinet Adrien, Killijian Marc-Olivier, and Lepoint Tancr`ede. NFLlib: NTT-Based Fast Lattice Library. In Kazue Sako, editor, Topics in Cryptology - CT-RSA 2016, pp. 341–356, Cham,
    2016. Springer International Publishing.
    [24] Shai Halevi and Victor Shoup. Faster Homomorphic Linear Transformations in HElib. In Hovav Shacham and Alexandra Boldyreva, editors, Advances in Cryptology – CRYPTO 2018, pp. 93–120, Cham, 2018. Springer International
    Publishing.
    31

    View Slide

  32. 参考文献 (iii)
    [25] Bossuat Jean-Philippe, Christian Mouchet, Troncoso-Pastoriza Juan, and Hubaux Jean-Pierre. Efficient Bootstrapping for Approximate Homomorphic Encryption with Non-sparse Keys. In Canteaut Anne and Fran ̧cois-Xavier Standaert,
    editors, Advances in Cryptology – EUROCRYPT 2021, pp. 587–617, Cham, 2021. Springer International Publishing.
    [26] PALISADE Lattice Cryptography Library (release 1.11.5). https://palisade-crypto.org/, 2021.
    [27] Martin Albrecht, Melissa Chase, Hao Chen, Jintai Ding, Shafi Goldwasser, Sergey Gorbunov, Shai Halevi, Jeffrey Hoffstein, Kim Laine, Kristin Lauter, Satya Lokam, Daniele Micciancio, Dustin Moody, Travis Morrison, Amit Sahai, and Vinod
    Vaikuntanathan. Homomorphic encryption standard. Cryptology ePrint Archive, Report 2019/939, 2019. https://ia.cr/2019/939.
    32

    View Slide

  33. Appendix
    33

    View Slide

  34. KeySwitch
    • 暗号文の暗号鍵を変更する演算
    • 内部的に使用する特殊な法の数: 𝑘
    34
    Appendix
    秘密鍵1
    134 134
    復号
    秘密鍵2
    134
    復号
    134
    KeySwitch

    View Slide

  35. 暗号文のデータ構造
    35
    Appendix
    𝑁: 多項式の次数
    𝑆: 2以上の整数
    𝑥: ある整数𝑄を法とした整数
    𝑥0,0
    ⋯ 𝑥0,𝑁−1
    𝑁
    𝑥0,0
    ⋯ 𝑥0,𝑁−1
    ⋮ ⋱ ⋮
    𝑥𝑆−1,0
    ⋯ 𝑥𝑆−1,𝑁−1
    𝑆
    𝑁
    暗号化
    復号
    平文 暗号文

    View Slide

  36. 剰余数系(Residue Number System: RNS)[14]
    ワードサイズに収まらない巨大な法𝑄を,
    中国剰余定理に基づいて,
    ワードサイズに収まるサイズの小さな複数の法𝑞𝑖
    に分割する演算
    [14] P V Ananda Mohan. Residue Number Systems. Springer International Publishing, 2016.
    36
    Appendix

    View Slide

  37. 暗号文のデータ構造(w/ RNS)
    37
    Appendix
    𝑁: 多項式の次数
    𝑆: 2以上の整数
    𝑙: 中国剰余定理によって分割された法の数(レベル)
    暗号化
    復号
    平文 暗号文

    𝑥0,0,0
    ⋯ ො
    𝑥0,0,𝑁−1
    ⋮ ⋱ ⋮

    𝑥0,𝑇−1,0
    ⋯ ො
    𝑥0,𝑇−1,𝑁−1
    𝑙
    𝑁

    𝑥𝑆−1,0,0
    ⋯ ො
    𝑥𝑆−1,0,𝑁−1
    ⋮ ⋱ ⋮

    𝑥𝑆−1,𝑇−1,0
    ⋯ ො
    𝑥𝑆−1,𝑇−1,𝑁−1
    ⋱ ⋱ ⋱
    ⋱ ⋱ ⋱
    ⋱ ⋱ ⋱

    𝑥0,0,0
    ⋯ ො
    𝑥0,0,𝑁−1
    ⋮ ⋱ ⋮

    𝑥0,𝑇−1,0
    ⋯ ො
    𝑥0,𝑇−1,𝑁−1
    𝑆
    𝑙
    𝑁

    View Slide