Skip to content

Commit a4a13a2

Browse files
authored
Merge pull request #2 from upbcuk/readme
Add README
2 parents 5d215c4 + 0137593 commit a4a13a2

1 file changed

Lines changed: 53 additions & 2 deletions

File tree

README.md

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,57 @@
11
[![Build Status](https://travis-ci.com/upbcuk/upb.crypto.math.svg?branch=master)](https://travis-ci.com/upbcuk/upb.crypto.math)
2+
## upb.crypto.math
23

3-
# upb.crypto.math
4-
Library providing mathematical basics for (pairing-based) cryptography.
4+
upb.crypto.math is a library providing a number of mathematical tools needed in many cryptographic applications.
55

6+
These include:
67

8+
* Elliptic curve groups with pairings
9+
* Type 1:
10+
* Supersingular Curve with Tate pairing
11+
* Type 3:
12+
* Barreto-Naehrig
13+
* Hashing
14+
* SHA-256
15+
* SHA-512
16+
* Mathematical structures:
17+
* Ring of integers modulo n
18+
* Ring of polynomials
19+
20+
## Example Code
21+
22+
As a starting point, we provide exemplary code of common tasks.
23+
24+
##### Setting up a Type 3 Bilinear Group
25+
26+
Given a security parameter `securityParameter`, we can set up a type 3 bilinear group using this library as follows:
27+
28+
```java
29+
BilinearGroupFactory fac = new BilinearGroupFactory(securityParameter);
30+
fac.setRequirements(BilinearGroup.Type.TYPE_3);
31+
BilinearGroup group = fac.createBilinearGroup();
32+
```
33+
34+
This chooses a type 3 bilinear group from predefined ones. Alternatively, the library enables it to register new groups by defining a `BilinearGroupProvider`.
35+
36+
##### Register your own Bilinear Group Implementation
37+
38+
Suppose you have your own implementation of a type 3 bilinear group and you want to use it in our library. To do so, you only need write a `MyBilinearGroupProvider` that implements the interface `BilinearGroupProvider`.
39+
Then, your group can be registered in the `BilinearGroupFactory` as follows:
40+
41+
```java
42+
BilinearGroupFactory fac = new BilinearGroupFactory(securityParameter);
43+
fac.registerProvider(Arrays.asList(new BarretoNaehrigProvider(), new MyBilinearGroupProvider()));
44+
fac.setRequirements(BilinearGroup.Type.TYPE_3);
45+
BilinearGroup group = fac.createBilinearGroup();
46+
```
47+
48+
As an example have a look at our module [upb.crypto.mclwrap](https://github.com/upbcuk/upb.crypto.mclwrap), which includes the pairing library [mcl](https://github.com/herumi/mcl) in our environment.
49+
50+
## Notes
51+
52+
The library was implemented at Paderborn University in the research group ["Codes und Cryptography"](https://cs.uni-paderborn.de/en/cuk/).
53+
54+
This module is the base of [CRACO](https://github.com/upbcuk/upb.crypto.craco) and [CLARC](https://github.com/upbcuk/upb.crypto.clarc) providing cryptographic constructions, and an anonymous credential and reputation system, respectively.
55+
56+
## Licence
57+
Apache License 2.0, see LICENCE file.

0 commit comments

Comments
 (0)