Skip to content

Commit 184e2d0

Browse files
authored
Merge pull request #114 from cryptimeleon/develop
Merge develop into main for release of v2.0.0
2 parents 3ceae3b + 793b7d4 commit 184e2d0

124 files changed

Lines changed: 1934 additions & 427 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/android.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Android CI
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- main
7+
- 'release/**'
8+
# Nightly builds to ensure dependencies don't break anything
9+
schedule:
10+
- cron: '0 0 * * *'
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up JDK 1.8
18+
uses: actions/setup-java@v1
19+
with:
20+
java-version: 1.8
21+
- name: Build with Gradle
22+
run: ./gradlew :build
23+
android:
24+
runs-on: macos-latest
25+
steps:
26+
- uses: actions/checkout@v2
27+
- name: Run tests on emulator
28+
uses: reactivecircus/android-emulator-runner@v2
29+
with:
30+
api-level: 28
31+
script: ./gradlew android-test:connectedAndroidTest -Pandroid.useAndroidX=true --info
Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
name: Java CI
1+
name: Development Java CI
22

3-
on: push
3+
on:
4+
push:
5+
branches-ignore:
6+
- main
7+
- 'release/**'
8+
# Nightly builds to ensure dependencies don't break anything
9+
schedule:
10+
- cron: '0 0 * * *'
411

512
jobs:
613
build:
@@ -12,4 +19,5 @@ jobs:
1219
with:
1320
java-version: 1.8
1421
- name: Build with Gradle
15-
run: ./gradlew build -PcheckoutIfCloned=true
22+
run: ./gradlew :build
23+

.github/workflows/main-ci.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Main Java CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 'release/**'
8+
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: Build with Gradle
19+
run: ./gradlew :build -Prelease
20+
android:
21+
runs-on: macos-latest
22+
steps:
23+
- uses: actions/checkout@v2
24+
- name: Run tests on emulator
25+
uses: reactivecircus/android-emulator-runner@v2
26+
with:
27+
api-level: 28
28+
script: ./gradlew android-test:connectedAndroidTest -Prelease -Pandroid.useAndroidX=true --info
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Scheduled Main Java CI
2+
3+
on:
4+
# Nightly builds to ensure dependencies don't break anything
5+
schedule:
6+
- cron: '0 0 * * *'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
with:
14+
ref: main # need to specify branch else it will check out develop
15+
- name: Set up JDK 1.8
16+
uses: actions/setup-java@v1
17+
with:
18+
java-version: 1.8
19+
- name: Build with Gradle
20+
run: ./gradlew :build -Prelease
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
name: Maven publishing
1+
name: Tagget release
22

33
on:
44
push:
5-
branches:
6-
- main
75
tags:
86
- v[1-9]+.[0-9]+.[0-9]+
97
jobs:
@@ -16,16 +14,19 @@ jobs:
1614
with:
1715
java-version: 1.8
1816
- name: Publish to the Maven Central Repository
19-
run: ./gradlew publish -PcheckoutIfCloned -Prelease
17+
run: ./gradlew :publish -Prelease
2018
env:
2119
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
2220
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
2321
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }}
2422
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }}
25-
- uses: "marvinpinto/action-automatic-releases@latest"
23+
- name: Github release
24+
uses: "marvinpinto/action-automatic-releases@latest"
2625
with:
2726
repo_token: "${{ secrets.GITHUB_TOKEN }}"
2827
prerelease: false
28+
draft: false
2929
files: |
3030
LICENSE
3131
build/libs/*.jar
32+
id: "automatic_releases"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
build/**
2+
android-test/build/**
23
.gradle/**
34
out/**
45
.idea/**
56
.composite-enable
67
gradle.properties
8+
local.properties

CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,35 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## [Unreleased]
8+
9+
### Added
10+
- Additional operator overload methods added to `ExponentExpr`
11+
- `BasicBilinearGroup` wrappers for the implemented bilinear groups
12+
- Convenience methods for the vector classes
13+
- `square`, `div` and `valueOf` convenience methods for `Zn` and `Zp` classes
14+
- PRF classes from Craco now are part of Math
15+
- `ByteArrayImpl`, a byte array implementation
16+
17+
### Changed
18+
- Renamed "counting" group classes and package to "debug"
19+
- Made supersingular and Barreto-Naehrig implementation classes package-private (except those that are relevant to the user)
20+
- Made internal lazy group classes package-private
21+
- Adjusted some tests to work with the new package-private classes
22+
- Made representation handler classes package-private and moved the classes up a package
23+
- Made ring group impl classes package-private and moved inv and neg cost estimation to the `Ring` interface
24+
- Improved performance of finite field multiplication
25+
26+
### Fixed
27+
- Fixed `decomposeIntoDigits` method of `IntegerRing`
28+
29+
## [1.0.0] - 2021-03-01
30+
31+
### Added
32+
- Initial release
33+
34+
35+
[Unreleased]: https://github.com/cryptimeleon/math/compare/v1.0.0...HEAD
36+
[1.0.0]: https://github.com/cryptimeleon/math/releases/tag/v1.0.0
37+

DEVELOPER.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
This Gradle project consists of two sub-projects.
2+
The root project is the Math library itself.
3+
The `android-test` sub-project is only used to run the library's tests on Android.
4+
For that purpose it contains an Android-specific build file.
5+
6+
Since there are multiple sub-projects, you will need to prefix Gradle commands with a colon (`:`) if you want them to run only for the Math library and not the Android sub-project.
7+
For example, instead of `./gradlew build` use `./gradlew :build` to build the Math library.
8+
The former will fail since the android sub-project is not configured to be actually buildable.
9+
See [here](https://docs.gradle.org/current/userguide/intro_multi_project_builds.html) for more information on how multi-project builds work.

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
![Build Status](https://github.com/cryptimeleon/math/workflows/Java%20CI/badge.svg)
1+
![Build Status](https://github.com/cryptimeleon/math/workflows/Development%20Java%20CI/badge.svg)
2+
![Build Status](https://github.com/cryptimeleon/math/workflows/Main%20Java%20CI/badge.svg)
3+
![Build Status](https://github.com/cryptimeleon/math/workflows/Scheduled%20Main%20Java%20CI/badge.svg)
4+
![Build Status](https://github.com/cryptimeleon/math/workflows/Android%20CI/badge.svg)
25
## Math
36

47
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.
8+
It implements basics such as mathematical groups, rings and fields, e.g. Zn, as well as implementations of cryptographic pairings.
9+
Furthermore, it offers serialization support for the implemented structures.
710

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

android-test/build.gradle

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
buildscript {
2+
repositories {
3+
google()
4+
mavenCentral()
5+
}
6+
7+
dependencies {
8+
classpath 'com.android.tools.build:gradle:4.2.1'
9+
classpath("de.mannodermaus.gradle.plugins:android-junit5:1.7.1.1")
10+
}
11+
}
12+
13+
apply plugin: 'com.android.library'
14+
apply plugin: "de.mannodermaus.android-junit5"
15+
16+
android {
17+
compileSdkVersion 30
18+
defaultConfig {
19+
minSdkVersion 28
20+
targetSdkVersion 30
21+
22+
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
23+
// JUnit 5 support for instrumentation tests
24+
testInstrumentationRunnerArgument "runnerBuilder", "de.mannodermaus.junit5.AndroidJUnit5Builder"
25+
}
26+
27+
// make the android-test subproject just reuse the math stuff
28+
sourceSets {
29+
main {
30+
java.srcDirs = ["../src/main/java"]
31+
}
32+
33+
// unit tests. Run via test task
34+
test {
35+
java.srcDirs = ["../src/test/java"]
36+
}
37+
38+
androidTest {
39+
java.srcDirs = ["../src/test/java"]
40+
}
41+
}
42+
43+
compileOptions {
44+
setSourceCompatibility(JavaVersion.VERSION_1_8)
45+
setTargetCompatibility(JavaVersion.VERSION_1_8)
46+
}
47+
48+
testOptions {
49+
unitTests {
50+
all {
51+
useJUnitPlatform()
52+
maxParallelForks 4
53+
//we want display the following test events
54+
testLogging {
55+
events "PASSED", "STARTED", "FAILED", "SKIPPED"
56+
}
57+
afterSuite { desc, result ->
58+
if (!desc.parent) { // will match the outermost suite
59+
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
60+
def startItem = '| ', endItem = ' |'
61+
def repeatLength = startItem.length() + output.length() + endItem.length()
62+
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
63+
}
64+
}
65+
}
66+
}
67+
}
68+
}
69+
70+
repositories {
71+
mavenCentral()
72+
google()
73+
}
74+
75+
dependencies {
76+
implementation group: 'com.googlecode.json-simple', name: 'json-simple', version:'1.1'
77+
implementation group: 'org.reflections', name: 'reflections', version:'0.9.10'
78+
79+
// (Required) Writing and executing Unit Tests on the JUnit Platform
80+
testImplementation "org.junit.jupiter:junit-jupiter-api:5.7.1"
81+
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.7.1"
82+
83+
// (Optional) If you need "Parameterized Tests"
84+
testImplementation "org.junit.jupiter:junit-jupiter-params:5.7.1"
85+
86+
// (Optional) If you also have JUnit 4-based tests
87+
testImplementation "junit:junit:4.13"
88+
testRuntimeOnly "org.junit.vintage:junit-vintage-engine:5.7.1"
89+
90+
// Instrumentation test stuff
91+
androidTestImplementation "androidx.test:runner:1.3.0"
92+
androidTestImplementation "org.junit.jupiter:junit-jupiter-api:5.7.1"
93+
androidTestImplementation "org.junit.jupiter:junit-jupiter-params:5.7.1"
94+
95+
androidTestImplementation "de.mannodermaus.junit5:android-test-core:1.2.2"
96+
androidTestRuntimeOnly "de.mannodermaus.junit5:android-test-runner:1.2.2"
97+
}

0 commit comments

Comments
 (0)