Implementation of research paper from Canetti, Halevi and Katz A Forward-Secure Public-Key Encryption Scheme
In A Forward-Secure Public-Key Encryption Scheme, the authors make use of a bilinear pairing function of type 1,
namely a function where both inputs come from the same elliptic curve group as
For that reason we had to modify the original work to use a type 3 pairing function of the form
SecretKey represents a secret key used to decrypt a ciphertext.
SecretKeys represents a stack composed of SecretKey.
epsilon represents the empty string.
The fspke scheme is based on a Binary Tree encryption scheme. A binary tree composed of N nodes is deployed and its pre-order transversal will determine the correspondence between a period and a node.
By example, if we have $N = 15$, here is the corresponding binary tree. Each node is composed of a binary word $w_i$ where the root word is the empty string $w_0 = \epsilon$. The following pre-oder transversal allows to get a correspondence between a period and a node and therefore a word (see function _compute\_wi_ in [utils.rs](./src/utils.rs))
Here is the matching between period and word
| Period index |
word |
|---|---|
| 0 | |
| 1 | 0 |
| 2 | 00 |
| 3 | 000 |
| 4 | 001 |
| 5 | 01 |
| 6 | 010 |
| 7 | 011 |
| 8 | 1 |
| 9 | 10 |
| 10 | 100 |
| 11 | 101 |
| 12 | 11 |
| 13 | 110 |
| 14 | 111 |
Takes as input
Public key will always remain the same and secret key will vary over periods.
Takes as input the public key (which stores parameter
Takes as input the public key, the word corresponding to the node of the current period
Takes as input the public key, the index of the current period
pub struct Ciphertext {
u0: G1Affine,
ui: Vec,
v: Fq12,
}
Takes as input the public key, the index of the current period
Takes the total amount of periods
Takes as input the total amount of periods
A straightforward function that converts a string input into a G2Affine element.

