forked from fhetextbook/fhetextbook.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path00-main.tex
More file actions
667 lines (455 loc) · 18.5 KB
/
00-main.tex
File metadata and controls
667 lines (455 loc) · 18.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
\PassOptionsToPackage{colorlinks=true,linkcolor=blue,urlcolor=blue}{hyperref}
\documentclass[11pt]{article}
%\usepackage[top=1in, bottom=1in, left=1cm, right=1cm]{geometry}
%\usepackage{lipsum}
%\usepackage{background}
%\backgroundsetup{
% position=current page.east,
% angle=-90,
% nodeanchor=east,
% vshift=-5mm,
% opacity=1,
% scale=3,
% contents=Confidential
%}
\usepackage{amsmath,amssymb,amsthm,bm} % TeX4ht relies on these
\usepackage{mathtools} % optional but harmless
\usepackage{rotating}
\usepackage[margin=1cm, paperwidth=8.5in, paperheight=11in]{geometry}
\usepackage[
hypertexnames=false
]{hyperref}
\usepackage{kotex}
\usepackage{etex}
\usepackage{fullpage}
\usepackage{mathtools}
\usepackage{amsfonts}
\usepackage{graphicx}
\usepackage{amsthm}
\usepackage[utf8]{inputenc}
\usepackage{afterpage}
\usepackage{adjustbox}
\usepackage{placeins}
\usepackage{fixltx2e}
\usepackage{supertabular}
\usepackage{titlesec}
\usepackage{array}
\usepackage{tabularx}
\usepackage{color}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{subcaption}
\usepackage{hyperref}
\usepackage{pgfplots}
\usepackage{relsize}
\let\labelindent\relax
\usepackage{enumitem}
\usepackage{fancyhdr}
\usepackage{alltt}
\usepackage{soul}
\usepackage{fancyvrb}
\usepackage{xcolor}
%\usepackage[english,greek]{babel}
%\usepackage{ucs}
%\usepackage[utf8x]{inputenc}
%\usepackage[usenames,dvipsnames]{xcolor}
%\usepackage{tikz}
%\usepackage{tkz-tab}
%\usepackage{caption}
%\usepackage{latexsym}
%\usepackage{amssymb}
\usepackage[margin=0.1cm]{subcaption}
\usepackage{multicol}
\usepackage{refcount}
\usepackage{breakurl} % Break URL
\usepackage{multirow}
\usepackage[most]{tcolorbox}
%\usepackage[breakable,skins]{tcolorbox}
\tcbset{breakable}
\usepackage{esvect}
\usepackage{hyperref}
\usepackage{mathdots}
\usepackage{pifont}
\usepackage{booktabs}
\usepackage{arydshln}
\usepackage{xcolor}
\def\UrlBreaks{\do\/\do-\do\_}
\usepackage{mathtools}
\usepackage{array}
\usepackage{hyperref}
\usepackage{hyperref}
\usepackage{mathtools, nccmath}
%\usepackage[style=numeric,sorting=none]{biblatex}
%\usepackage[lite]{mtpro2}
\usepackage{titling}
\renewcommand\maketitlehooka{\null\mbox{}\vfill}
\renewcommand\maketitlehookd{\vfill\null}
\DeclarePairedDelimiter{\nint}\lfloor\rceil
\DeclarePairedDelimiter{\abs}\lvert\rvert
\usepackage{tocloft}
\usepackage{pdflscape}
\usepackage[all=normal, floats, bibnotes, wordspacing, charwidths, indent]{savetrees}
\makeatletter%
\captionsetup{belowskip=0pt}
\usepackage{enumitem}
\setlist{nolistsep}
%\setlist[itemize]{leftmargin=0.1}
\setlist[itemize]{leftmargin=*}
\setlist[enumerate]{leftmargin=*}
% align figures to the top margin
\makeatletter
\setlength{\@fptop}{0pt}
\newcommand\bunderline{}% check for being undefined
\DeclareRobustCommand\bunderline[1]{\mathord{\mathpalette\b@underline{#1}}}
\newcommand{\b@underline}[2]{%
\sbox\z@{$\m@th#1\underline{#2}$}%
\raisebox{-\dp\z@}{\scalebox{.5}[.25]{$\m@th#1[$}}%
\copy\z@
\raisebox{-\dp\z@}{\scalebox{.5}[.25]{$\m@th#1]$}}%
}
\makeatother
%\renewcommand{\figureautorefname}{foo}
%\renewcommand{\tableautorefname}{bar}
%\usepackage[all=normal, floats, bibnotes, wordspacing, charwidths, indent, lists]
%\captionsetup{belowskip=0pt}
\usepackage{graphicx}
\def\rotatecharone#1{\rotatebox[origin=c]{180}{#1}}
\def\rotatechartwo#1{\reflectbox{#1}}
\usepackage{hyperref}
\skip\footins 0.5\baselineskip %8.1pt plus 4pt minus 2pt
\floatsep 0.5\baselineskip
\textfloatsep 0.5\baselineskip
\intextsep 0.5\baselineskip
\dbltextfloatsep 0.5\baselineskip
\dblfloatsep 0.5\baselineskip
%\raggedbottom
\belowcaptionskip 0pt
\everypar{\looseness=-1 }
\setlength{\abovecaptionskip}{0pt} %
\newenvironment{myproof}[1][\proofname]{%
\begin{proof}[#1]$ $\par\nobreak\ignorespaces
}{%
\end{proof}
}
\makeatletter
\renewcommand{\sectionautorefname}{\S\@gobble}
\renewcommand{\subsectionautorefname}{\S\@gobble}
\renewcommand{\subsubsectionautorefname}{\S\@gobble}
\renewcommand{\appendixautorefname}{\S\@gobble}
\renewcommand{\appendixautorefname}{\S\@gobble}
\newcommand\mymathcolor[2]{{\color{#1}#2}}
\makeatother
\newcommand{\ignore}[1]{}
% Add additional comma in the math mode
%\DeclareMathSymbol{,}{\mathpunct}{letters}{"2C}
%\newcommand{\comma}{\mathpunct{\mkern\thinmuskip}}
%\mathcode`,=\string"8000
%{\catcode`,=\active \gdef,{\comma}}
\addtolength{\cftsecnumwidth}{15pt}
\addtolength{\cftsubsecnumwidth}{10pt}
\addtolength{\cftsubsubsecnumwidth}{10pt}
\makeatletter%
\usepackage{stackengine,xcolor}
\input pdf-trans
\newbox\qbox
\def\usecolor#1{\csname\string\color@#1\endcsname\space}
\newcommand\bordercolor[1]{\colsplit{1}{#1}}
\newcommand\fillcolor[1]{\colsplit{0}{#1}}
\newcommand\colsplit[2]{\colorlet{tmpcolor}{#2}\edef\tmp{\usecolor{tmpcolor}}%
\def\tmpB{}\expandafter\colsplithelp\tmp\relax%
\ifnum0=#1\relax\edef\fillcol{\tmpB}\else\edef\bordercol{\tmpC}\fi}
\def\colsplithelp#1#2 #3\relax{%
\edef\tmpB{\tmpB#1#2 }%
\ifnum `#1>`9\relax\def\tmpC{#3}\else\colsplithelp#3\relax\fi
}
\newcommand\outline[1]{\leavevmode%
\def\maltext{#1}%
\setbox\qbox=\hbox{\maltext}%
\boxgs{Q q 2 Tr \thickness\space w \fillcol\space \bordercol\space}{}%
\copy\qbox%
}
\newcommand\mathcalbb[2][1]{%
\stackengine{0pt}{\def\thickness{.55}\outline{$\mathcal{#2}$}}{\kern.1pt\outline{$\mathcal{#2}$}}{O}{l}{F}{F}{L}}
\bordercolor{black}
\fillcolor{white}
\def\thickness{.1}% TO CHANGE THICKNESS OF SHADOW
\usepackage{lmodern}
\usepackage{lipsum}
\makeatletter
\DeclareRobustCommand{\ccong}{\mathrel{\mathpalette\@verequiv\sim}}
\newcommand{\@verequiv}[2]{%
\lower.5\p@\vbox{
\lineskiplimit\maxdimen
\lineskip-.5\p@
\ialign{%
$\m@th#1\hfil##\hfil$\crcr
#2\crcr
\equiv\crcr
}%
}%
}
\renewcommand*\env@matrix[1][c]{\hskip -\arraycolsep
\let\@ifnextchar\new@ifnextchar
\array{*\c@MaxMatrixCols #1}}
\newcommand{\hathat}{\tilde}
%\newcommand{\hathat}[1]{%
%\begingroup%
% \let\macc@kerna\z@%
% \let\macc@kernb\z@%
% \let\macc@nucleus\@empty%
% \hat{\raisebox{.2ex}{\vphantom{\ensuremath{#1}}}\smash{\hat{#1}}}%
%\endgroup%
%}
\newcommand{\revise}[1]{{{\textcolor{black}{#1}}}}
\makeatother
% \title{**\vspace*{\fill}**The Beginner's Textbook for Fully Homomorphic Encryption}
% \date{January 1, 2025}
% \author{Ronny Ko**\vspace*{\fill}**}
\begin{document}
\title{\Huge{\textbf{The Beginner's Textbook}}\\ \Huge{\textbf{for Fully Homomorphic Encryption}}}
\author{
\textbf{Ronny Ko} \thanks{\large \textit{\text{Acknowledgments}:}\\
\textbf{Robin Geelen} (KU Leuven)\\
\textbf{Tianjian Yang} (Peking University)\\ \textbf{Yongwoo Lee} (Inha University) \\ \textbf{Nolan Carouge} (Grenoble INP Ensimag) \\
\textbf{Navid Abapour} (University of Surrey)
}
\\{LG Electronics Inc.}}%\\\texttt{\small{hajoon.ko@lge.com}}}
\date{}
\begin{titlingpage}
\maketitle
\end{titlingpage}
\clearpage
\section*{Preface}
Fully Homomorphic Encryption (FHE) is a cryptographic scheme that enables computations to be performed directly on encrypted data, as if the data were in plaintext. After all computations are performed on the encrypted data, it can be decrypted to reveal the result. The decrypted value matches the result that would have been obtained if the same computations had been applied to the plaintext data.
FHE supports basic operations such as addition and multiplication on encrypted numbers. Using these fundamental operations, more complex computations can be constructed, including subtraction, division, logic gates (e.g., AND, OR, XOR, NAND, MUX), and even advanced mathematical functions such as ReLU, sigmoid, and trigonometric functions (e.g., sin, cos). These functions can be implemented either as exact formulas or as approximations, depending on the trade-off between computational efficiency and accuracy.
FHE enables privacy-preserving machine learning by allowing a server to process the client’s data in its encrypted form through an ML model. With FHE, the server learns neither the plaintext version of the input features nor the inference results. Only the client, using their secret key, can decrypt and access the results at the end of the service protocol.
FHE can also be applied to confidential blockchain services, ensuring that sensitive data in smart contracts remains encrypted and confidential while maintaining the transparency and integrity of the execution process.
Other applications of FHE include secure outsourcing of data analytics, encrypted database queries, privacy-preserving searches, efficient multi-party computation for digital signatures, and more.
This book is designed to help the reader understand how FHE works at the mathematical level. The book comprises the following four parts:
$ $
\begin{itemize}
\item \textbf{\autoref{part:basic-math}:~\nameref{part:basic-math}} explains necessary background concepts for FHE, such as groups, fields, orders, polynomial rings, cyclotomic polynomials, vectors and matrices, the Chinese Remainder Theorem, Taylor series, polynomial interpolation, and the Fast Fourier Transform.
\item \textbf{\autoref{part:pqc}:~\nameref{part:pqc}} explains well-known lattice-based cryptographic schemes, which include LWE, RLWE, GLWE, GLev, and GGSW cryptosystems.
\item \textbf{\textbf{\autoref{part:generic-fhe}:~\nameref{part:generic-fhe}}} explains the generic techniques of FHE adopted by many existing schemes, such as homomorphic addition, multiplication, modulus switching, and key switching.
\item \textbf{\textbf{\autoref{part:fhe-schemes}:~\nameref{part:fhe-schemes}}} explains four widely used FHE schemes: TFHE, BFV, CKKS, and BGV, as well as their RNS-variant versions.
\end{itemize}
$ $
%These parts are designed in an incremental manner, and therefore understanding each part requires the understanding of its prior part(s).
%$ $
This book is available both as an \href{https://arxiv.org/abs/2503.05136}{\textbf{arXiv PDF}} and on an \href{https://fhetextbook.github.io} {\textbf{auto-generated dynamic website}} (powered by \href{https://www.kodymirus.cz/overleaf-html-sample/main.html}{make4ht}). We provide a Python Demo FHE library (TFHE, BFV, BGV, CKKS) for educational purposes, which is available at \href{https://github.com/fhetextbook/fhe-textbook}{\texttt{https://github.com/fhetextbook/fhe-textbook}}.
Please report any errors regarding the book draft on the \href{https://github.com/fhetextbook/fhe-textbook/issues}{\textbf{Issues Board}}.
\subsubsection*{Acknowledgments}
Special thanks go to the following researchers: Robin Geelen (KU Leuven, \href{mailto:robin.geelen@esat.kuleuven.be}{robin.geelen@esat.kuleuven.be}), for his thoughtful and dedicated feedback; Yongwoo Lee (Inha University, \href{mailto:yongwoo@inha.ac.kr}{yongwoo@inha.ac.kr}), for his general advice; Tianjian Yang (Peking University, \href{mailto:robin.geelen@esat.kuleuven.be}{2300012738@stu.pku.edu.cn}), for correcting numerous typos and other errors throughout the draft; Nolan Carouge (Grenoble INP Ensimag, \href{mailto:nolan.carouge.pro@gmail.com}{nolan.carouge.pro@gmail.com}), for proof-reading Part 1; and Navid Abapour (University of Surrey, \href{mailto:n.abapour@surrey.ac.uk}{n.abapour@surrey.ac.uk}), for proof-reading Part 3 and 4.
\thispagestyle{empty}
\newpage
\tableofcontents
%\newcommand{\subparagraph}{} % /usepackage{titlesec}
\titleformat*{\section}{\LARGE\bfseries\scshape}
\titleformat*{\subsection}{\Large\bfseries}
\titleformat*{\subsubsection}{\bfseries}
\titleformat*{\paragraph}{\itshape\subsubsectionfont}
\titleformat*{\subparagraph}{\large\bfseries}
% page header foot
%\usepackage{fancyhdr}
%\pagestyle{fancy}
%\lhead{Security and Privacy in Cyber-Physical Systems: Foundations and Applications}
%\rfoot{Copyright \textcopyright 2016 by Wiley}
% \thispagestyle{fancy}, after \maketitle
\newcommand{\para}[1]{\vspace{0.05in}\noindent{\bf{#1}}}
\newcommand{\white}[1]{{\textcolor{white}{#1}}} % phantom upgrade
\newcommand{\gap}[1]{\text{ } \text{#1} \text{ }}
\newcommand{\tboxlabel}[1]{$\bm{\langle}$Summary~{#1}$\bm{\rangle}$}
\newcommand{\tboxdef}[1]{$\bm{\langle}$Definition~{#1}$\bm{\rangle}$}
\newcommand{\tboxtheorem}[1]{$\bm{\langle}$Theorem~{#1}$\bm{\rangle}$}
\newtheorem{proposition}{Proposition}
\newtcolorbox[blend into=tables]{mytable}[2][]{float=htb, halign=center, title={#2}, every float=\centering, #1}
% $\hat Y = \frac{1}{1 + e^{-Z}}$.
% $Z = {w_1 \cdot X_1 + w_2 \cdot X_2 + \dots + w_n \cdot X_n + b}$
\clearpage
%\section{Background}
\part{Basic Math}
\label{part:basic-math}
\renewcommand{\thesection}{A-\arabic{section}}
\setcounter{section}{0}
This chapter explains the basic mathematical components of number theory: group, field, order, roots of unity, cyclotomic polynomial, polynomial ring, and decomposition. These are essential building blocks for post-quantum cryptography.
\clearpage
\section{Modulo Arithmetic}
\label{sec:modulo}
\input{a01-modulo}
\clearpage
\section{Group}
\label{sec:group}
\input{a02-group}
\clearpage
\section{Field}
\label{sec:field}
\input{a03-field}
\clearpage
\section{Order}
\label{sec:order}
\input{a04-order}
\clearpage
\section{Polynomial Ring}
\label{sec:polynomial-ring}
\input{a05-polynomial-ring}
\clearpage
\section{Decomposition}
\label{sec:decomp}
\input{a06-decomp}
\clearpage
\section{Roots of Unity}
\label{sec:roots}
\input{a07-roots-of-unity}
\clearpage
\section{Cyclotomic Polynomial}
\label{sec:cyclotomic}
\input{a08-cyclotomic-polynomial}
\clearpage
\section{Roots of Unity and Cyclotomic Polynomial over Rings}
\label{sec:cyclotomic-polynomial-integer-ring}
\input{a09-cyclotomic-polynomial-integer-ring}
\clearpage
\section{Vector and Matrix}
\label{sec:matrix}
\input{a10-matrix}
\clearpage
\section{Euler's Formula}
\label{sec:euler}
\input{a11-euler}
\clearpage
\section{Modulo Rescaling}
\label{sec:modulus-rescaling}
\input{a12-modulus-rescaling}
\clearpage
\section{Chinese Remainder Theorem}
\label{sec:chinese-remainder}
\input{a13-chinese-remainder}
\clearpage
\section{Taylor Series}
\label{sec:taylor-series}
\input{a14-taylor-series}
\clearpage
\section{Lagrange's Polynomial Interpolation}
\label{sec:polynomial-interpolation}
\input{a15-polynomial-interpolation}
\clearpage
\section{Efficient Polynomial Multiplication by FFT and NTT}
\label{sec:ntt}
\input{a16-ntt}
\clearpage
\part{Post-quantum Cryptography}
\label{part:pqc}
\renewcommand{\thesection}{B-\arabic{section}}
\setcounter{section}{0}
This chapter explains lattice-based cryptographic schemes: LWE cryptosystem, RLWE cryptosystem, GLWE cryptosystem, GLev cryptosystem, and GGSW cryptosystem. These are the essential building blocks for FHE schemes.
$ $
\begin{tcolorbox}[
title = \textbf{Required Background}, % box title
colback = white, % light background; tweak to taste
colframe = black, % frame colour
boxrule = 0.8pt, % line thickness
left = 1mm, right = 1mm, top = 1mm, bottom = 1mm % inner padding
]
\begin{itemize}
\item \autoref{sec:group}: \nameref{sec:group}
\item \autoref{sec:field}: \nameref{sec:field}
\item \autoref{sec:polynomial-ring}: \nameref{sec:polynomial-ring}
\end{itemize}
\end{tcolorbox}
$ $
\clearpage
\section{Lattice-based Cryptography}
\label{sec:lattice}
\input{b01-lattice}
\clearpage
\section{LWE Cryptosystem}
\label{sec:lwe}
\input{b02-lwe}
\clearpage
\section{RLWE Cryptosystem}
\label{sec:rlwe}
\input{b03-rlwe}
\clearpage
\section{GLWE Cryptosystem}
\label{sec:glwe}
\input{b04-glwe}
\clearpage
\section{GLev}
\label{sec:glev}
\input{b05-glev}
\clearpage
\section{GGSW}
\label{sec:ggsw}
\input{b06-ggsw}
\clearpage
\part{Generic Fully Homomorphic Encryption}
\label{part:generic-fhe}
\renewcommand{\thesection}{C-\arabic{section}}
\setcounter{section}{0}
This chapter explains the generic techniques of homomorphic computation adopted by various FHE schemes such as TFHE, CKKS, BGV, and BFV,
As we learned from \autoref{sec:glwe}, $\textsf{GLWE}_{S,\sigma}(\Delta M + E) = (A_0, A_1, \gap{$\cdots$} , A_{k-1}, B) \in \mathcal{R}_{\langle n, q \rangle }^{k + 1}$, where $\mathcal{R}_{\langle n,q \rangle} = \mathbb{Z}_q[x] / (x^n + 1)$, and $B$ is computed as $B = \sum\limits_{i=0}^{k-1}{(A_i \cdot S_i)} + \Delta \cdot M + E$. Each $A_i$ is an $(n-1)$-degree polynomial as a public key, whose each coefficient is uniformly randomly sampled from $\mathcal{R}_{\langle n, q \rangle }$. $E$ is an $(n-1)$-degree polynomial as a noise, whose each coefficient is sampled from $\mathcal{R}_{\langle n, q \rangle }$ based on the Gaussian distribution $\chi_\sigma$. $S$ is a list of $k$ $(n-1)$-degree polynomials as a secret key, such that $S = (S_0, S_1, \gap{$\cdots$} S_{k-1} ) \in \mathcal{R}_{\langle n, q \rangle }^k$, and each polynomial $S_i$'s each coefficient is a randomly sampled binary number in $\mathbb{Z}_2$ (i.e., $\{0, 1\}$).
Based on this GLWE setup, this section will explain the following 5 homomorphic operations: ciphertext-to-ciphertext addition, ciphertext-to-plaintext addition, ciphertext-to-plaintext multiplication, ciphertext-to-ciphertext multiplication, and key switching.
\clearpage
\section{GLWE Ciphertext-to-Ciphertext Addition}
\label{sec:glwe-add-cipher}
\input{c01-glwe-add-cipher}
\clearpage
\section{GLWE Ciphertext-to-Plaintext Addition}
\label{sec:glwe-add-plain}
\input{c02-glwe-add-plain}
\clearpage
\section{GLWE Ciphertext-to-Plaintext Multiplication}
\label{sec:glwe-mult-plain}
\input{c03-glwe-mult-plain}
\clearpage
\section{GLWE Modulus Switching}
\label{sec:modulus-switching}
\input{c04-glwe-modulus-switch}
\clearpage
\section{GLWE Key Switching}
\label{sec:glwe-key-switching}
\input{c05-glwe-key-switching}
\clearpage
%\section{GLWE Input Vector Rotation}
%\label{sec:glwe-input-rotation}
%\input{c06-glwe-input-rotation}
%\clearpage
\part{Fully Homomorphic Encryption Schemes}
\label{part:fhe-schemes}
\renewcommand{\thesection}{D-\arabic{section}}
\setcounter{section}{0}
This chapter explains the four most well-known FHE schemes: TFHE, CKKS, BGV, and BFV, as well as their RNS-variant versions.
\newpage
\section{TFHE Scheme}
\label{sec:tfhe}
\input{d01-tfhe}
\newpage
\section{BFV Scheme}
\label{sec:bfv}
\input{d02-bfv}
\newpage
\section{CKKS Scheme}
\label{sec:ckks}
\input{d03-ckks}
\clearpage
\section{BGV Scheme}
\label{sec:bgv}
\input{d04-bgv}
\clearpage
\section{RNS-variant FHE Schemes}
\label{sec:rns}
\input{d05-rns}
\clearpage
\section{FHE Scheme Comparison and Summary}
\input{d06-scheme-summary}
\clearpage
\section{Python Demo FHE Library}
\input{d07-python-demo-library}
%\input{scratch}
\clearpage
\bibliographystyle{unsrt}
\bibliography{z-bibfile}
%\clearpage
%\input{scratch-real}
\end{document}
%https://www.youtube.com/watch?v=vYKdh5oQ4Zw