Skip to content

Commit

Permalink
upload post
Browse files Browse the repository at this point in the history
  • Loading branch information
healthykim committed Jul 17, 2024
1 parent ad0d812 commit 2b535f1
Show file tree
Hide file tree
Showing 7 changed files with 130 additions and 38 deletions.
44 changes: 22 additions & 22 deletions content/Basic Algebra/Basic Algebra.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
> [!Info]
> [[Basic Algebra]] provides foundational knowledge essential for understanding cryptographic systems. It covers key algebraic concepts such as groups, fields, and rings, which are important to understand cryptographic algorithms.
[[Binary Operation]]
[[Monoid]]
[[Group]]
[[Subgroup]]
[[Cyclic Subgroup]]
[[Ring]]
[[Binary Relation]]
[[Equivalence Relation]]
[[Quotient Ring]]
[[Ring Homomorphism]]
[[Field]]
[[Finite Field]]
[[Cyclotomic polynomial]]
[[Discrete Fourier Transform]]
[[Fast Fourier Transform]]
[[Number Theoretic Transform]]
[[Residue Number System]]
[[Chinese Remainder Theorem]]
[[Automorphism]]
[[Elliptic Curves]]
[[Discrete logarithm]]
[[ECDLP]]
- [[Binary Operation]]
- [[Monoid]]
- [[Group]]
- [[Subgroup]]
- [[Cyclic Subgroup]]
- [[Ring]]
- [[Binary Relation]]
- [[Equivalence Relation]]
- [[Quotient Ring]]
- [[Ring Homomorphism]]
- [[Field]]
- [[Finite Field]]
- [[Cyclotomic polynomial]]
- [[Discrete Fourier Transform]]
- [[Fast Fourier Transform]]
- [[Number Theoretic Transform]]
- [[Residue Number System]]
- [[Chinese Remainder Theorem]]
- [[Automorphism]]
- [[Elliptic Curves]]
- [[Discrete logarithm]]
- [[ECDLP]]

21 changes: 21 additions & 0 deletions content/Basic Algebra/Discrete Fourier Transform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: Discrete Fourier Transform
---

# Definition
The Discrete Fourier Transform (DFT) refers to the Fourier transform applied to discrete values (discrete time to discrete frequency). When computed using the Fast Fourier Transform (FFT), the DFT can be calculated quickly in O(nlogn) time for n values. Therefore, it can be used to efficiently compute polynomial multiplication or vector convolution, which would otherwise require $O(n^2)$ time (where n is the degree of the polynomial).

# n-th root of unity

^1735c9

The **n-th root of unity** is a concept that plays a crucial role in the computation of the DFT. Mathematically, an n-th root of unity is a complex number $\omega$ that satisfies $\omega^n=1$. Therefore, there can be n such $\omega$, each of which can be expressed as $\omega^k = e^{-2\pi ik/n}$, where k is an integer ranging from 0 to n−1, and i is the imaginary unit. These roots are uniformly distributed on the unit circle.
![[root of unity.png]]
[Image source](https://homepages.math.uic.edu/~jan/mcs472/discretefourier.pdf)

# Discrete Fourier Transfrom
Let x = $[x_0, x_1, ..., x_{n-1}]^T$ be an n-dimensional vector, the discrete fourier transform of x is y = $[y_0, y_1, ..., y_{n-1}]^T$ where ^8ba133

$$y_k = \sum_{j=0}^{n-1} x_j \omega^{jk},\quad w=e^{-i2\pi/n}, k=0,1,2, ..., N-1$$ The inverse transform can be defined as

$$x_n= {1\over N} \sum_{j=0}^{n-1} y_j \omega^{-jk}$$
35 changes: 35 additions & 0 deletions content/Basic Algebra/Fast Fourier Transform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: Fast Fourier Transfrom
---
# Definition
Fast Fourier Transform (FFT) is a technique that utilizes the periodicity of the root of unity to perform the [[Discrete Fourier Transform]] in \(O(n \log n)\) time. [Root of Unity]([[Discrete Fourier Transform#^1735c9]]) has the following property: $$\omega^{n/2+j}=-\omega^j$$ Using this property, we can divide the DFT calculation of length \(N\) into two DFT calculations of length \(N/2\). This is known as the Danielson-Lanczos Lemma and forms the basis of the FFT.

# Danielson-Lanczos Lemma
The DFT of length \(N\) (where \(N\) is even) can be expressed as the sum of two DFTs of length \(N/2\). One is formed from the even-indexed terms, and the other from the odd-indexed terms. [The DFT formula]([[Discrete Fourier Transform#^8ba133]]) can be expressed, according to the Danielson-Lanczos Lemma, as follows:

$$
\begin{align}
y_k &= \sum_{j=0}^{n-1} x_j \omega^{jk} \\ & = x_0\omega^0 + x_2\omega^{2k} + x_4\omega^{4k} + \ldots + x_{n-2}\omega^{k(n-2)} \\ & \quad + \omega^k (x_1\omega^0 + x_3\omega^{2k} + x_5\omega^{4k} + \ldots + x_{n-1}\omega^{k(n-2)}) \\ &= \sum_{j=0}^{n/2-1} x_{2j} \omega^{2kj} + \omega^k \sum_{j=0}^{n/2-1} x_{2j+1} \omega^{2kj} \\ &= y^E_k + \omega^k y_k^O
\end{align}
$$

# Algorithm: Cooley-Tukey Algorithm
Cooley-Tukey algorithm is designed for Fast Fourier Transform (FFT) algorithm. This algorithm significantly reduces the time complexity of computing the DFT from $O(N^2)$ to $O(N \log N)$.

The Cooley-Tukey algorithm uses a divide-and-conquer method to break down the input signal into smaller parts. Cooley-Tukey algorithm then performs the Fourier transform on each part, and combines the results to obtain the final transform. It is particularly effective for input lengths that are powers of two.

**Pseudo code**
```
function FFT(A, ω)
Input: Coefficient representation of a polynomial A(x) of degree ≤ n − 1, where n is a power of 2
Output: Value representation A(ω^0), . . . , A(ω^n−1)
if ω = 1: return A(1)
express A(x) in the form Ae(x^2) + xAo(x^2)
call FFT(Ae, ω^2) to evaluate Ae at even powers of ω
call FFT(Ao, ω^2) to evaluate Ao at odd powers of ω
for j = 0 to n − 1:
compute A(ω^j) = Ae(ω^2j) + ω^jAo(ω^2j)
return A(ω^0), . . . , A(ω^n−1)
```
36 changes: 36 additions & 0 deletions content/Basic Algebra/Residue Number System.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: Residue Number System
---
Residue Number System(RNS)은 정수를 표현하고 연산하는 데에 사용되는 number system의 하나로, 병렬 연산에 유리하다는 특징이 있다. RNS에서는 정수를 여러 개의 서로 다른 서로소인 정수들(이후 기수 집합이라고 부르게 되는 것)으로 표현하며, 기반이 되는 원리에는 [[Chinese remainder theorem]]가 있다. 즉 서로소인 정수들이 주어졌을 때, 이들에 대한 연립 합동식의 해가 유일하다는 것에 기반하여 여러 서로소 정수들로 하나의 정수를 나타낼 수 있는 것이다.

## RNS Representation
RNS에서 정수 X는 다음과 같이 k개의 정수로 나타낼 수 있다.
$$X \equiv \{x_1, x_2, x_3, ..., x_k\} \quad (mod \space \{m_1, m_2, m_3, m_4, ..., m_k\})$$
여기서 ${m_1, m_2, m_3, …, m_k}$ 는 RNS의 기수(base) 집합이다.

예를 들어 기수 집합 {3, 5, 7}을 사용하는 RNS에서 정수 23은 (2, 3, 2)로 표현된다.
$$
\begin{align} 23 \equiv 2 \quad& (mod \space 3) \\ 23 \equiv 3 \quad& (mod \space 5) \\ 23 \equiv 2 \quad& (mod \space 7) \\ \end{align}
$$

## Arithmetic operations
### Add
RNS에서의 덧셈은 단순한 residue끼리의 덧셈을 수행하여 이루어진다. 뺄셈 및 곱셈도 마찬가지로 수행된다.
$$ \begin{align} \{x_1, x_2, x_3, ..., x_k\} +\{y_1, y_2, y_3, ..., y_k\} =\{& x_1 +y_1 (mod \space m_1), \\ & x_2 +y_2 (mod \space m_2), \\ &..., \\ &x_k +y_k (mod \space m_k)\} \end{align} $$

### Subtract
$$ \begin{align} \{x_1, x_2, x_3, ..., x_k\} +\{y_1, y_2, y_3, ..., y_k\} =\{& x_1 -y_1 (mod \space m_1), \\ & x_2 -y_2 (mod \space m_2), \\ &..., \\ &x_k -y_k (mod \space m_k)\} \end{align} $$

### Multiply
$$ \begin{align} \{x_1, x_2, x_3, ..., x_k\} +\{y_1, y_2, y_3, ..., y_k\} =\{& x_1 \cdot y_1 (mod \space m_1), \\ & x_2 \cdot y_2 (mod \space m_2), \\ &..., \\ &x_k \cdot y_k (mod \space m_k)\} \end{align} $$

### Divide
나눗셈은 나누는 수의 모듈로 역원을 이용해 계산한다. 따라서 다음과 같이 수행된다.

$$ \begin{align} \{x_1, x_2, x_3, ..., x_k\} +\{y_1, y_2, y_3, ..., y_k\} =\{& x_1 \cdot y_1^{-1} (mod \space m_1), \\ & x_2 \cdot y_2^{-1} (mod \space m_2), \\ &..., \\ &x_k \cdot y_k^{-1} (mod \space m_k)\} \end{align} $$

### Comparison
동일성의 경우 두 수의 residue들이 동일하면 두 수도 동일하다고 판단한다.
대소비교의 경우 직접적으로 수행하기 어려우며 일반적으로는 전체 값을 복원하여 연산한다.
Binary file added content/Basic Algebra/images/root of unity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 10 additions & 10 deletions content/Basic Cryptography/Basic Cryptography.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
> [[Basic Cryptography]] introduces the fundamental principles and techniques of cryptography. This includes basic encryption and decryption methods, and the principles behind key cryptographic algorithms such as symmetric and asymmetric encryption.

[[Public key cryptography]]
[[Symmetric key cryptography]]
[[Diffie-Hellman]]
[[RSA]]
[[ElGamal]]
[[ECDSA]]
[[Post quantum cryptography]]
[[Learning with Errors(LWE)]]
[[Ring Learning with Errors(RLWE)]]
[[Module Learning with Errors(MLWE)]]
- [[Public key cryptography]]
- [[Symmetric key cryptography]]
- [[Diffie-Hellman]]
- [[RSA]]
- [[ElGamal]]
- [[ECDSA]]
- [[Post quantum cryptography]]
- [[Learning with Errors(LWE)]]
- [[Ring Learning with Errors(RLWE)]]
- [[Module Learning with Errors(MLWE)]]
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
> [[Privacy Enhancing Technologies (PET)]] explains advanced cryptographic methods designed to protect user privacy. It covers technologies such as zero-knowledge proofs, secure multi-party computation, and homomorphic encryption.

[[Homomorphic Encryption]]
[[Secure Multiparty Computation]]
[[Differential Privacy]]
[[Federated Learning]]
[[Trusted Execution Environment]]
[[Zero Knowledge Proofs]]
- [[Homomorphic Encryption]]
- [[Secure Multiparty Computation]]
- [[Differential Privacy]]
- [[Federated Learning]]
- [[Trusted Execution Environment]]
- [[Zero Knowledge Proofs]]

0 comments on commit 2b535f1

Please sign in to comment.