Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
330 commits
Select commit Hold shift + click to select a range
02e97dd
Added initial version of ValueBundle
Jan 31, 2020
31576b8
Remove expression performance tests
Jan 31, 2020
186e387
added bit decomposition into IntegerRing
Jan 31, 2020
e1bb4ec
Add precompute evaluation whenever possible to opt evaluator plus a test
Feb 8, 2020
4f8e279
Merge branch 'expr-opt' of github.com-rheitjoh:upbcuk/upb.crypto.math…
Feb 8, 2020
2172cf7
Refactor Opt Evaluator class into more smaller classes
Feb 10, 2020
1bcb36e
Add system for rewriting terms to expressions plus some basic rules
Feb 15, 2020
bfc1aa4
Make PairingGtExprRule exclude variable exponents for move
Feb 19, 2020
ef7e55d
Fix broken rulerewrite test
Feb 19, 2020
b083331
Fix precomputer trying to evaluate variables in base of powexpr
Feb 19, 2020
572cf6a
Add more rules to TRS and tests
Feb 19, 2020
708bb09
Refactor expr rule structure for adding boolean rules
Feb 26, 2020
a9ecf63
Add rule for rewriting group equality
Feb 26, 2020
c58f46c
Add valueBundle support for booleans
Feb 26, 2020
699f692
Add rules for moving exponent vars out of pairing
Feb 27, 2020
2414667
Almost finish support for merging ANDs of GroupEqualityExprs
Feb 27, 2020
d44762b
Finish implementing merging of ANDs and some tests
Feb 28, 2020
25d2530
Change version to 2.0.0
Mar 3, 2020
e02aecb
Remove optimize from evaluators
Mar 4, 2020
3bbd6e1
Optimize imports
Mar 5, 2020
5b5364e
Disable probabilistic AND merging by default
Mar 5, 2020
27ba6c4
Add option to evaluator to disable all caching
Mar 5, 2020
e610239
Added mul(BigInteger) to rings
Mar 7, 2020
d2bd96a
Merge branch 'master' into expr-opt
Mar 7, 2020
4612c57
Added mul(BigInteger) to Cartesian group
Mar 7, 2020
e790f85
Rename probabilisticANDMerging to probabilisticAndMerging to keep wit…
Mar 7, 2020
41bed03
Merge branch 'master' into shorterRepr
Mar 7, 2020
d41fbf2
Fix classes using previously removed representation types
Mar 7, 2020
828e026
Merge pull request #6 from upbcuk/shorterRepr
rheitjoh Mar 7, 2020
4275376
Generalized substitution with ValueBundle
Mar 8, 2020
4b1f65f
Added ability to UBR a map
Mar 9, 2020
4efe4d8
Merge branch 'master' into expr-opt
Mar 9, 2020
c04ca31
Changed Substitutions interface
Mar 9, 2020
6cd9302
Replaced some if-then-else lists with tree walks
Mar 10, 2020
8934ac6
Added putIfMissing to ObjectRepresentation
Mar 10, 2020
dc1ad3b
Merge branch 'master' into expr-opt
Mar 10, 2020
4dd00d9
Changed getVariables() from returning the variable names to returning…
Mar 10, 2020
afa5484
Minor fix
Mar 10, 2020
a1a6085
Additional performance tests, disabled simultaneous and WNAF, as they…
Mar 11, 2020
3f183d1
Merge branch 'expr-opt' of github.com-rheitjoh:upbcuk/upb.crypto.math…
Mar 11, 2020
6f4aa3b
Additional performance tests, disabled simultaneous and WNAF, as they…
Mar 11, 2020
151b304
Remove mclwrap again and add some test stuff for setAccessible
Mar 14, 2020
e876518
Remove debugging prints in restoreField
Mar 14, 2020
0cf2a94
Add more javadocs to evaluator classes and methods
Mar 20, 2020
9dac107
Add small optimization to multi exponentiations by giving initial cap…
Mar 20, 2020
20c9e65
Try unsuccessfully to optimize WNAF digit computation
Mar 21, 2020
12eab96
Slightly optimize simultaneous multiexp
Mar 21, 2020
d8baf95
Fix wrong caching size selected for no caching simultaneous
Mar 21, 2020
db90833
Fix Javadoc warnings
Mar 26, 2020
b8815b8
Add class for storing cached powers in the group element itself
Mar 28, 2020
db3685a
More sliding vs simultaneous testing
Apr 2, 2020
6ca43c5
Added a bunch of shortcuts
Apr 21, 2020
2f36958
Update README.md
feidens Apr 21, 2020
d1fb382
Added hasPrimeSize()
Apr 22, 2020
883a18a
Merge branch 'master' into expr-opt
Apr 22, 2020
e352423
Added ability to typecast ExponentExpr to GroupElementExpr
Apr 22, 2020
1c6e97b
Added more methods to ExponentExpr, EmptyExpr is now 0 instead of 1
Apr 22, 2020
bcf9851
Fixed missing group attribute for ZnAsGroupElemExpr
Apr 22, 2020
ad9c2c5
Added multiplication and exponentiation with scalars to rings/exponen…
Apr 22, 2020
a54ded7
Improve handling of unknown expressions in opt evaluator and fix powW…
Apr 28, 2020
4416747
Revert exception catch in powWnaf
Apr 29, 2020
de6a5db
Merge pull request #9 from upbcuk/redme-patch-hints
Apr 29, 2020
1b38f9e
Add @Ignore to a benchmark and add support for registering BilinearMa…
May 6, 2020
f5596f6
Add Enum.class back to StandaloneRepresentationHandler which fixes en…
May 12, 2020
6832321
Add support for generic types to StandaloneRepresentable, fix issue #10
May 12, 2020
1bf0883
Remove maven plugin from build.gradle as its superceded by maven-publish
May 13, 2020
e12e99d
Add timeout to group tests so mcl tests dont run for forever
May 30, 2020
c14c92f
Add parameter switch to enable MCL dependency
Jun 10, 2020
e478ac4
Update gradle and implement test feature variant
Jun 22, 2020
72cc747
Remove mclwrap dependency
Jun 27, 2020
8683e2f
Basically mostly working version
Jul 24, 2020
6fd1594
Merge branch 'expr-opt' into lazy
Jul 24, 2020
44227b6
Remove invalid imports and fix error introduced by merging expr-opt
Jul 25, 2020
96f7a76
Fix DebugBilinearGroup Representation tests and improve a couple of e…
Jul 25, 2020
01d42b7
Added support for calling getter methods in restorerStrings
Jul 31, 2020
7e5bb09
Added BilinearGroupImpl and fixed tests
Jul 31, 2020
4a92303
Add prototype operation and exponentiation counting
Aug 4, 2020
46d2002
Remove containsDebugGroup from LazyGroup representation to reduce ser…
Aug 5, 2020
71d0d8b
Make containsDebugGroup in LazyGroup private again after last test
Aug 5, 2020
393fe0e
Remove log4j dependency and fix simplerandomgenerator package declara…
Aug 6, 2020
abb0207
Merge pull request #19 from upbcuk/remove-log4j
rheitjoh Aug 7, 2020
5c0fab2
Start working on new counting prototype for #14
Aug 17, 2020
0d6ca5a
Add retrieved representations counter to DebugGroupImpl to address is…
Aug 19, 2020
50bde8d
Add CountingGroup and CountingGroupElement to address the synchronici…
Aug 21, 2020
ef25ae3
Improve CountingGroup to wrap two LazyGroups, #14
Aug 31, 2020
af7c3b8
Finish new CountingGroup prototype, #14
Sep 1, 2020
1215247
Merge pull request #12 from upbcuk/new-ci
Sep 1, 2020
e00ff58
Implement CountingBilinearGroup, #14
Sep 3, 2020
abce3b0
Save prototype of CountingBilinearGroup before rewrite
Sep 4, 2020
176a7a1
Rewrite CountingBilinearGroup to use two internal LazyBilinearGroups,…
Sep 4, 2020
0358173
Fixed issues with LazyGroup
Sep 5, 2020
e3e3877
Fixed #16
Sep 5, 2020
ae82197
Fixed computation bugs
Sep 7, 2020
970efe7
Small improvements + GroupTests
Sep 7, 2020
f78186a
Improved performance of Zn slightly (I think)
Sep 7, 2020
a67053d
Add equals and hashCode methods to Counting classes and fix standalon…
Sep 7, 2020
a251ec7
Add pairings counter to CountingBilinearGroup plus counter formatting…
Sep 7, 2020
e51a34a
Move pairing counter to DebugBilinearMapImpl so it get only counted o…
Sep 7, 2020
c8a89a0
Merge branch 'lazy' into op-counting
Sep 7, 2020
0c92440
Fixed mystery concurrency bug
Sep 7, 2020
3a5739b
Fixed another potentially bad typo
Sep 7, 2020
65a229a
Add tests for operation counting, #14
Sep 8, 2020
d4fcef3
Merge branch 'master' into op-counting
Sep 9, 2020
d538052
Fixed Zn error
Sep 9, 2020
dc84964
Merge branch 'lazy' into op-counting
Sep 9, 2020
c1b0de4
Fixed another error committed during the Zn change
Sep 9, 2020
1c5cbc5
Added Vectors
Sep 9, 2020
e6b821b
Lots of random changes
Sep 9, 2020
36ea8c6
Replaced arrays with lists in vectors
Sep 9, 2020
ff33a85
Merge branch 'lazy' into op-counting
Sep 10, 2020
fd40310
Fix representation ser/der of CountingGroupElement
Sep 10, 2020
fd99538
More convenience methods and made pow(RingElement) a thing
Sep 10, 2020
d186d23
Added secp256k1 elliptic curve
Sep 11, 2020
7b3946d
added precomputePow(int windowSize)
Sep 11, 2020
f3ff154
Fixed compile error
Sep 11, 2020
f1e52f2
Fix pairingCounting test after change to exponentiation in pairing ap…
Sep 12, 2020
ad1a2ca
Merge branch 'lazy' into op-counting
Sep 12, 2020
3d8d5a0
Add missing precomputePow(int windowSize) method to CountingGroupElement
Sep 12, 2020
43a23e3
Remove travis snapshot stage
Sep 12, 2020
f4a4395
Merge pull request #24 from upbcuk/op-counting
Sep 12, 2020
5273d6a
Fix CountingHomomorphism to apply the LazyHomomorphism to the actual …
Sep 14, 2020
112b85c
Add CountingHomomorphism test
Sep 14, 2020
c6d9546
Merge pull request #26 from upbcuk/hotfix-counting-hom
Sep 14, 2020
f4b6d48
Sped up computation of wnaf form by a factor of 10
Sep 17, 2020
d9ce351
Merge pull request #28 from upbcuk/fasterWnaf
rheitjoh Sep 18, 2020
7d4c5e7
Add different sliding window negative exponent approaches
Oct 7, 2020
3337b3c
Delete old manual tests and compare sliding A1 and A2
Oct 9, 2020
1a628d2
Decide on using slidingWindowA1 and add configuration options to Lazy…
Oct 15, 2020
ff541a5
Implement negative exponent handling for sliding window multiexp and …
Oct 23, 2020
4a299fb
Add method for precomputing negative powers to GroupElement interface…
Oct 23, 2020
931cf15
Add toString support for multi-exponentiations
Oct 26, 2020
314652f
Add better support for using negative precomputations for wNAF multie…
Oct 28, 2020
b960e06
Start adding inversion cost estimations to GroupImpl
Oct 29, 2020
d325c5c
Finish adding inversion to group op cost estimations and add option t…
Oct 31, 2020
c4edf3e
Merge precomputePow and precomputeNegPow and implement a rudimentary …
Nov 2, 2020
b9e9a13
Fix an issue where the other power array would be null which would le…
Nov 2, 2020
7529523
Remove JUnitPerf dependency
Nov 12, 2020
bcc9faa
Remove redundant @code from javadoc
Nov 17, 2020
20a12eb
Improve javadoc formatting of GroupElement and Element
Nov 18, 2020
510a9b6
Continue reformatting and improving javadoc up to RingElement
Nov 19, 2020
bf0fbab
More javadoc fixes
Nov 19, 2020
46fc4e3
More javadoc improvements up to HashIntoDebugGroupImpl
Nov 19, 2020
179c29c
Add a gradle javadoc task with mathJax support and improve more javad…
Nov 21, 2020
3ded745
More javadoc improvements. Also deprecate remaining classes of the v1…
Nov 21, 2020
642bacf
More javadoc improvements and improve some equals methods to be symme…
Nov 23, 2020
50fad6b
Finish preliminary new javadoc comments
Nov 23, 2020
7461950
Merge pull request #30 from upbcuk/more-multi-exp
Nov 24, 2020
5e4c97e
Remove < tag warnings, add package level javadocs, begin working thro…
Nov 25, 2020
1b2a3e7
Add javadocs to everything in expressions.bool and make member variab…
Nov 25, 2020
7ff221b
Add more javadoc to expressions.exponent
Nov 26, 2020
0d7556b
Add javadoc to group expressions
Nov 26, 2020
530c989
make some factory package javadoc improvements
Nov 26, 2020
2e13c34
Improve javadocs for the factory package classes
Nov 28, 2020
023d4c9
Continue improving javadoc up to Element
Nov 30, 2020
2bb2a90
Finish improving javadoc of interfaces folder
Nov 30, 2020
6e36581
Improve randomness javadocs
Nov 30, 2020
8eb55a0
Improve javadoc of v2.internal classes
Dec 2, 2020
d51deb4
Improve javadoc up to ListRepresentation
Dec 2, 2020
2f6dc49
Finish javadoc overhaul of serialization classes
Dec 3, 2020
5e645b2
Improve javadoc for structures and reverse some access modifier chang…
Dec 3, 2020
ffdf4d8
Undo all protected to private access level modification done previous…
Dec 5, 2020
dda77c1
Start adding javadocs to Vector
Dec 5, 2020
099fbf8
Fix tests by undoing some equals changes
Dec 7, 2020
dd12c03
Finish javadoc overhaul
Dec 7, 2020
b9838bf
Fix some minor javadoc issues and add use javadocLatex task for the j…
Dec 7, 2020
b078b33
Correct gradle javadoc jar build script
Dec 7, 2020
a8969df
Merge branch 'master' into improve-javadoc
rheitjoh Dec 15, 2020
62d4879
Create a prototype of how bilinear groups may look after removing the…
Dec 17, 2020
03c1171
Fix remaining tests
Dec 30, 2020
ed4acc5
Start adding javadocs to Counting classes
Dec 30, 2020
837cb7b
Add javadocs for all counting group classes
Dec 31, 2020
a2da321
Merge pull request #35 from upbcuk/improve-javadoc
rheitjoh Jan 4, 2021
65ba836
Merge branch 'master' into bilfac-redesign
Jan 4, 2021
cbc9409
Add lazy wrapper classes for bilinear group impls and move performanc…
Jan 4, 2021
59faa1e
Add standlone test parameters for new bilgroup lazy wrapper classes
Jan 4, 2021
07de481
Make ZnElement and ZpElement's equals compatible with each other
Jan 5, 2021
85c4a05
Add a bit more javadocs to the pairing classes
Jan 5, 2021
1576771
Merge pull request #36 from upbcuk/bilfac-redesign
rheitjoh Jan 5, 2021
332e472
Changes for protocols library
Jan 9, 2021
d540e80
Merge branch 'protocolupdates' into master
Jan 9, 2021
5e6bfcb
Fixed merge errors
Jan 9, 2021
2483157
Fixed CountingGroupElement representation
Jan 10, 2021
aea4102
Make some javadoc improvements
Jan 11, 2021
6f71f3c
Merge pull request #37 from upbcuk/protocolupdates
Jan 12, 2021
5de2f0a
Remove deprecated representations code and move v2 to its folder
Jan 19, 2021
178b9b7
Remove remaining deprecated code
Jan 19, 2021
5f4f0d8
Remove all @author tags
Jan 19, 2021
d45d7bf
Optimize all imports and remove unnecessary setAccessible call in Ubr…
Jan 19, 2021
8e87437
Refactor JSONPrettyPrinter to a Converter Class
Jan 20, 2021
1cbf730
Reorganize test packages to more closely match src code structure
Jan 20, 2021
f585eff
Prune more unused classes for #40
Jan 20, 2021
3eec37f
Reorganize packages for #39
Jan 20, 2021
f28d624
Add HashIntoGroup Interface
Jan 21, 2021
c6ef47c
Merge pull request #42 from upbcuk/hash-into-group
rheitjoh Jan 21, 2021
2cc573e
Simplified RandomGenerator interface
Jan 21, 2021
1b9b6a0
Added vectors of expressions
Jan 21, 2021
f5c23c7
Fix merge conflicts and move HashIntoGroup and HashIntoStructure towa…
Jan 21, 2021
97fca4b
Added new constructor to Vector
Jan 22, 2021
9109054
Remove RECOVERY_METHOD from Element class
Jan 23, 2021
4e459a8
Add new methods to PolynomialRing to enable similar functionality to …
Jan 23, 2021
737194e
Remove previously added Polynomial functionality
Jan 23, 2021
c4054ea
Merge pull request #44 from upbcuk/expression-vec
rheitjoh Jan 27, 2021
93ea88e
Merge branch 'master' into remove-depr
Jan 27, 2021
2acae27
Fix imports in GroupElementExpressionVector
Jan 27, 2021
c08a7b5
Split travis build stage gradle build into install and script phases
Jan 28, 2021
981cabd
Revert api key change in travis yml
Jan 30, 2021
0c61e38
Replace travis config with github actions ci file
Feb 1, 2021
cddca28
Reduce javadoc linting
Feb 1, 2021
6424a15
Add LagrangeUtils taken from Craco and add a group element exponent i…
Feb 2, 2021
18dc1a9
Merge pull request #38 from upbcuk/remove-depr
rheitjoh Feb 3, 2021
b95ba61
Hash function into Secp256k1
Feb 4, 2021
93e871e
Added test parameters
Feb 4, 2021
c7ed4ba
Making tests faster
Feb 4, 2021
ab14ec1
BN final exponentiation via Frobenius
Feb 4, 2021
678b3fa
Improved Javadoc
Feb 5, 2021
baad963
Merge pull request #45 from upbcuk/hashIntoSecp256
Feb 5, 2021
8dfc50b
New ability to concurrently evaluate bool exprs
Feb 5, 2021
369e4fe
Remove java.xml.bind dependency as it is unused
Feb 9, 2021
057f77c
Merge pull request #50 from upbcuk/remove-xmlbind
rheitjoh Feb 10, 2021
796767c
Merge pull request #49 from upbcuk/protocolupdates
Feb 10, 2021
cb9dc89
Rename project package and set version to 1.0.0
Feb 20, 2021
22abab0
Merge pull request #51 from cryptimeleon/rename
rheitjoh Feb 22, 2021
7a564e2
Minor improvements
Feb 25, 2021
8f21bc7
Merge pull request #56 from cryptimeleon/accumulatorRework
Feb 26, 2021
2ca06a6
Rename getX representation restoration methods to restoreX
Feb 26, 2021
9bfa2f6
Rename recreateFromRepresentation to restoreFromRepresentation
Feb 26, 2021
9b631b7
Merge pull request #57 from cryptimeleon/rename-get-foo
Feb 26, 2021
4f3a8a0
Add a new README
Feb 26, 2021
3c40511
Reworked StandaloneTest
Feb 26, 2021
4834452
Merge branch 'master' into testspeed
Feb 26, 2021
52b8eca
Fixed disappearing u
Feb 26, 2021
70f26dc
Improved error message for ReprUtil
Feb 26, 2021
f4543ff
Merge pull request #58 from cryptimeleon/new-readme
rheitjoh Feb 27, 2021
bbfa497
Merge pull request #46 from cryptimeleon/testspeed
Feb 27, 2021
305360c
Merge branch 'master' into standalonetest
Feb 27, 2021
13b1771
Fixed failing test
Feb 27, 2021
245b445
Merge pull request #59 from cryptimeleon/standalonetest
Feb 27, 2021
216f945
Improved reuse for StandaloneReprTests
Feb 27, 2021
333d716
Merge pull request #60 from cryptimeleon/sanitypass
Feb 27, 2021
9f80155
Merge pull request #61 from cryptimeleon/ReprTestReuse
Feb 27, 2021
60e8687
Fixed discovery of StandaloneRepresentable classes
Feb 27, 2021
f61bccf
Merge pull request #62 from cryptimeleon/standalonefix
rheitjoh Feb 27, 2021
707ee52
Improved exception handling
Feb 27, 2021
2f7d702
Merge pull request #63 from cryptimeleon/exceptionsImprove
rheitjoh Feb 27, 2021
32a7eb2
Fixed handling of null representables in ReprUtil
Mar 1, 2021
fbd2d9c
Removed unnecessary imports
Mar 1, 2021
684cac8
Merge pull request #64 from cryptimeleon/fix-reprutil
Mar 1, 2021
7c069c1
Adds Gradle configuration to publish over ossrh to maven central (#54)
feidens Mar 1, 2021
9a38cac
Merge branch 'release/v1.0.0' into main
feidens Mar 1, 2021
bc6f7d3
Merge tag 'vv1.0.0' into develop
feidens Mar 1, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 15 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Java CI

on: push

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Gradle
run: ./gradlew build -PcheckoutIfCloned=true
24 changes: 24 additions & 0 deletions .github/workflows/pub.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Maven publishing

on:
push:
branches:
- main
tags:
- v[1-9]+.[0-9]+.[0-9]+
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Publish to the Maven Central Repository
run: ./gradlew publish -PcheckoutIfCloned -Prelease
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
build/**
.gradle/**
.gradle/**
out/**
.idea/**
.composite-enable
gradle.properties
38 changes: 0 additions & 38 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
142 changes: 98 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,111 @@
[![Build Status](https://travis-ci.com/upbcuk/upb.crypto.math.svg?branch=master)](https://travis-ci.com/upbcuk/upb.crypto.math)
## upb.crypto.math

upb.crypto.math is a library providing a number of mathematical tools needed in many cryptographic applications.

These include:

* Elliptic curve groups with pairings
* Type 1:
* Supersingular Curve with Tate pairing
* Type 3:
* Barreto-Naehrig
* Hashing
* SHA-256
* SHA-512
* Mathematical structures:
* Ring of integers modulo n
* Ring of polynomials

## Example Code

As a starting point, we provide exemplary code of common tasks.
![Build Status](https://github.com/upbcuk/upb.crypto.craco/workflows/Java%20CI/badge.svg)
## Math

The Cryptimeleon Math library provides the mathematical foundation for the other Cryptimeleon libraries.
It provides basics such as mathematical groups, rings and fields, e.g. Zn, as well as implementations of cryptographic pairings.
Furthermore, it provides serialization support for the implemented structures.

## Security Disclaimer
**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.**

## Table Of Contents

* [Features Overview](#features)
* [Quickstart Guide](#quickstart)
* [Maven Installation](#installation-with-maven)
* [Gradle Installation](#installation-with-gradle)
* [Tutorials](#tutorials)
* [Pairing Performance](#note-regarding-pairing-performance)
* [Miscellaneous Information](#miscellaneous-information)
* [Authors](#authors)

## Features

Below we give a more detailed list of features.

### Groups

Math offers the following algebraic groups:

* Bilinear groups:
* Type 1 and type 3 pairings
* Elliptic curves without pairings:
* `Secp256k1`
* Symmetric group Sn
* Cartesian product group

### Rings

##### Setting up a Type 3 Bilinear Group
Math offers the following algebraic rings and fields:

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

```java
BilinearGroupFactory fac = new BilinearGroupFactory(securityParameter);
fac.setRequirements(BilinearGroup.Type.TYPE_3);
BilinearGroup group = fac.createBilinearGroup();
```
### Other Features

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

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

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`.
Then, your group can be registered in the `BilinearGroupFactory` as follows:
## Quickstart

```java
BilinearGroupFactory fac = new BilinearGroupFactory(securityParameter);
fac.registerProvider(Arrays.asList(new BarretoNaehrigProvider(), new MyBilinearGroupProvider()));
fac.setRequirements(BilinearGroup.Type.TYPE_3);
BilinearGroup group = fac.createBilinearGroup();
### Installation With Maven
To add the newest Math version as a dependency, add this to your project's POM:

```xml
<dependency>
<groupId>org.cryptimeleon</groupId>
<artifactId>math</artifactId>
<version>1.0.0</version>
</dependency>
```

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

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

The library was implemented at Paderborn University in the research group ["Codes und Cryptography"](https://cs.uni-paderborn.de/en/cuk/).
For example:

```groovy
repositories {
mavenCentral()
}

dependencies {
implementation group: 'org.cryptimeleon', name: 'math', version: '1.0.0'
}
```

### Tutorials

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

## Licence
Apache License 2.0, see LICENCE file.
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).

## Note Regarding Pairing Performance

The included java pairings are not optimized for performance.
We recommend you use our [Mcl wrapper library](https://github.com/cryptimeleon/mclwrap) if you care about pairing performance.
It includes an optimized type 3 pairing.

## Miscellaneous Information

- Official Documentation can be found [here](https://cryptimeleon.github.io/).
- The *For Contributors* area includes information on how to contribute.
- Math adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
- The changelog can be found [here](CHANGELOG.md).
- Math is licensed under Apache License 2.0, see [LICENSE file](LICENSE).

## Authors
The library was implemented at Paderborn University in the research group ["Codes und Cryptography"](https://cs.uni-paderborn.de/en/cuk/).
Loading