Skip to content

Commit 9a38cac

Browse files
committed
Merge branch 'release/v1.0.0' into main
2 parents c139c47 + 7c069c1 commit 9a38cac

402 files changed

Lines changed: 19362 additions & 12384 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Java CI
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Set up JDK 1.8
11+
uses: actions/setup-java@v1
12+
with:
13+
java-version: 1.8
14+
- name: Build with Gradle
15+
run: ./gradlew build -PcheckoutIfCloned=true

.github/workflows/pub.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Maven publishing
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- v[1-9]+.[0-9]+.[0-9]+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set up JDK 1.8
15+
uses: actions/setup-java@v1
16+
with:
17+
java-version: 1.8
18+
- name: Publish to the Maven Central Repository
19+
run: ./gradlew publish -PcheckoutIfCloned -Prelease
20+
env:
21+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
22+
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
23+
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }}
24+
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }}

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
build/**
2-
.gradle/**
2+
.gradle/**
3+
out/**
4+
.idea/**
5+
.composite-enable
6+
gradle.properties

.travis.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

README.md

Lines changed: 98 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,111 @@
1-
[![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
3-
4-
upb.crypto.math is a library providing a number of mathematical tools needed in many cryptographic applications.
5-
6-
These include:
7-
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.
1+
![Build Status](https://github.com/upbcuk/upb.crypto.craco/workflows/Java%20CI/badge.svg)
2+
## Math
3+
4+
The Cryptimeleon Math library provides the mathematical foundation for the other Cryptimeleon libraries.
5+
It provides basics such as mathematical groups, rings and fields, e.g. Zn, as well as implementations of cryptographic pairings.
6+
Furthermore, it provides serialization support for the implemented structures.
7+
8+
## Security Disclaimer
9+
**WARNING: This library is meant to be used for prototyping and as a research tool *only*. It has not been sufficiently vetted for use in security-critical production environments. All implementations are to be considered experimental.**
10+
11+
## Table Of Contents
12+
13+
* [Features Overview](#features)
14+
* [Quickstart Guide](#quickstart)
15+
* [Maven Installation](#installation-with-maven)
16+
* [Gradle Installation](#installation-with-gradle)
17+
* [Tutorials](#tutorials)
18+
* [Pairing Performance](#note-regarding-pairing-performance)
19+
* [Miscellaneous Information](#miscellaneous-information)
20+
* [Authors](#authors)
21+
22+
## Features
23+
24+
Below we give a more detailed list of features.
25+
26+
### Groups
27+
28+
Math offers the following algebraic groups:
29+
30+
* Bilinear groups:
31+
* Type 1 and type 3 pairings
32+
* Elliptic curves without pairings:
33+
* `Secp256k1`
34+
* Symmetric group Sn
35+
* Cartesian product group
36+
37+
### Rings
2338

24-
##### Setting up a Type 3 Bilinear Group
39+
Math offers the following algebraic rings and fields:
2540

26-
Given a security parameter `securityParameter`, we can set up a type 3 bilinear group using this library as follows:
41+
* Boolean ring
42+
* Cartesian product ring
43+
* Field extension class for polynomials of the form x^d + c
44+
* Integer ring
45+
* Polynomial ring
46+
* Ring Zn and Field Zp for prime p
2747

28-
```java
29-
BilinearGroupFactory fac = new BilinearGroupFactory(securityParameter);
30-
fac.setRequirements(BilinearGroup.Type.TYPE_3);
31-
BilinearGroup group = fac.createBilinearGroup();
32-
```
48+
### Other Features
3349

34-
This chooses a type 3 bilinear group from predefined ones. Alternatively, the library enables it to register new groups by defining a `BilinearGroupProvider`.
50+
Math also implements a number of other features:
3551

36-
##### Register your own Bilinear Group Implementation
52+
* Multi-exponentiation algorithms
53+
* Deferred evaluation of group operations for automatic application of those multi-exponentiation algorithms
54+
* Serialization features that integrate with the implemented algebraic structures
55+
* Group operation counting capabilities
56+
* A random generator
57+
* Hash function implementations such as SHA256 and SHA512
3758

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:
59+
## Quickstart
4060

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();
61+
### Installation With Maven
62+
To add the newest Math version as a dependency, add this to your project's POM:
63+
64+
```xml
65+
<dependency>
66+
<groupId>org.cryptimeleon</groupId>
67+
<artifactId>math</artifactId>
68+
<version>1.0.0</version>
69+
</dependency>
4670
```
4771

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.
72+
### Installation With Gradle
4973

50-
## Notes
74+
Math is published via Maven Central.
75+
Therefore, you need to add `mavenCentral()` to the `repositories` section of your project's `build.gradle` file.
76+
Then, add `implementation group: 'org.cryptimeleon', name: 'math', version: '1.0.0'` to the `dependencies` section of your `build.gradle` file.
5177

52-
The library was implemented at Paderborn University in the research group ["Codes und Cryptography"](https://cs.uni-paderborn.de/en/cuk/).
78+
For example:
79+
80+
```groovy
81+
repositories {
82+
mavenCentral()
83+
}
84+
85+
dependencies {
86+
implementation group: 'org.cryptimeleon', name: 'math', version: '1.0.0'
87+
}
88+
```
89+
90+
### Tutorials
5391

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.
92+
We recommend you go through our [short Math tutorial](https://cryptimeleon.github.io/getting-started/5-minute-tutorial.html) to get started.
5593

56-
## Licence
57-
Apache License 2.0, see LICENCE file.
94+
We also provide a walkthrough where we show you how to implement a pairing-based signature scheme [here](https://cryptimeleon.github.io/getting-started/pairing-tutorial.html).
95+
96+
## Note Regarding Pairing Performance
97+
98+
The included java pairings are not optimized for performance.
99+
We recommend you use our [Mcl wrapper library](https://github.com/cryptimeleon/mclwrap) if you care about pairing performance.
100+
It includes an optimized type 3 pairing.
101+
102+
## Miscellaneous Information
103+
104+
- Official Documentation can be found [here](https://cryptimeleon.github.io/).
105+
- The *For Contributors* area includes information on how to contribute.
106+
- Math adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
107+
- The changelog can be found [here](CHANGELOG.md).
108+
- Math is licensed under Apache License 2.0, see [LICENSE file](LICENSE).
109+
110+
## Authors
111+
The library was implemented at Paderborn University in the research group ["Codes und Cryptography"](https://cs.uni-paderborn.de/en/cuk/).

0 commit comments

Comments
 (0)