-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDDH.game
More file actions
25 lines (22 loc) · 797 Bytes
/
DDH.game
File metadata and controls
25 lines (22 loc) · 797 Bytes
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
// Decisional Diffie-Hellman assumption.
// Single-challenge version: the challenge is embedded in Initialize,
// so no Challenge oracle is needed.
// Left: (pk, g^r, pk^r) Right: (pk, g^r, random)
Game Left(Group G) {
[GroupElem<G>, GroupElem<G>, GroupElem<G>] Initialize() {
ModInt<G.order> a <- ModInt<G.order>;
GroupElem<G> pk = G.generator ^ a;
ModInt<G.order> r <- ModInt<G.order>;
return [pk, G.generator ^ r, pk ^ r];
}
}
Game Right(Group G) {
[GroupElem<G>, GroupElem<G>, GroupElem<G>] Initialize() {
ModInt<G.order> a <- ModInt<G.order>;
GroupElem<G> pk = G.generator ^ a;
ModInt<G.order> r <- ModInt<G.order>;
GroupElem<G> c <- GroupElem<G>;
return [pk, G.generator ^ r, c];
}
}
export as DDH;