Skip to content

Commit d9f2a4b

Browse files
committed
Some initial how-do-I
1 parent e57c36e commit d9f2a4b

1 file changed

Lines changed: 25 additions & 3 deletions

File tree

docs/how-do-I.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,29 @@ toc: true
77
This page addresses a bunch of questions of the form "how do I do xyz in Cryptimeleon?".
88
Consider it Stack-Overflow-style help.
99

10-
# How do I set up a group?
11-
# How do I compute a pairing?
12-
# How do I hash something?
10+
# How do I do group operations and pairings?
11+
12+
13+
# How do I hash into \\(\mathbb{Z}_n\\)?
14+
You can use `HashIntoZn` for this.
15+
```java
16+
BigInteger n = BigInteger.valueOf(99991); //just for the sake of example
17+
HashIntoZn hashFunction = new HashIntoZn(n);
18+
Zn.ZnElement hashVal = hashFunction.hash("Preimage");
19+
```
20+
21+
# How do I hash into a group \\(\mathbb{G}\\)?
22+
Bilinear groups provide hash functions as follows:
23+
```java
24+
GroupElement hashValue = bilinearGroup.getHashIntoG1().hash("Preimage");
25+
```
26+
27+
For other groups, there may be classes like named like `HashIntoSecp256k1`.
28+
29+
# How do I hash a list of group elements?
30+
31+
1332
# How do I send or store a group element?
33+
34+
35+
# My benchmark produces implausibly good numbers

0 commit comments

Comments
 (0)