Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge develop into main for release of v2.0.0 #114

Merged
merged 69 commits into from
Jun 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
495b7b2
Update pub.yaml
feidens Mar 3, 2021
961dd73
Update pub.yaml to only build on tags
feidens Mar 3, 2021
0f0ab0d
Improved finite field multiplication, no more modulo reduction.
JanBobolz Mar 19, 2021
d86a236
Merge pull request #73 from cryptimeleon/finitefieldmul
Mar 20, 2021
82f779b
Added convenience methods
JanBobolz Mar 26, 2021
afa100a
Added type overrides for bit decomp
JanBobolz Mar 31, 2021
d4ed628
Added isEqualTo() to ZnElements.
JanBobolz Mar 31, 2021
e0d3cc2
Fix number of digit computation for decompose in IntegerRing.java.
this-kramer Apr 5, 2021
d53def0
Fix docstring formatting
this-kramer Apr 5, 2021
c7e001f
Change comment
this-kramer Apr 5, 2021
287e097
Merge pull request #75 from cryptimeleon/hotfix/base-decompose-intege…
this-kramer Apr 5, 2021
ab95ec1
Added zn.valueOf(byte[])
JanBobolz Apr 8, 2021
154bc96
Some convenience methods
JanBobolz Apr 9, 2021
0ece366
Rename counting group classes and package to debug and increment vers…
rheitjoh Apr 17, 2021
dbd3810
Merge pull request #97 from cryptimeleon/rename-counting
rheitjoh Apr 19, 2021
dfeb70b
Modify recreateRepresentable such that it can access inaccessible con…
rheitjoh Apr 21, 2021
ecce272
Added ExponentExpr overloads to Zn
JanBobolz Apr 21, 2021
7aba683
Added append() and prepend() methods to Vectors
JanBobolz Apr 21, 2021
1fa343c
Merge pull request #74 from cryptimeleon/convenience
Apr 21, 2021
8ab66e1
Added additional overloads to ExponentExpr
JanBobolz Apr 21, 2021
a6f6dfe
Merge pull request #99 from cryptimeleon/overloads
Apr 22, 2021
5fdcb81
Merge pull request #94 from cryptimeleon/popk
Apr 22, 2021
5723627
Make supersingular and BN classes package-private and add basic versions
rheitjoh Apr 23, 2021
5e17145
Make representation handler classes package-private and move internal…
rheitjoh Apr 23, 2021
857c472
Start making debug group package-private
rheitjoh Apr 23, 2021
2f4b3c8
Split ci up into dev, release and scheduled release, and add badges t…
rheitjoh Apr 26, 2021
6be95a4
Make lazy classes package-private and fix ExpTests and GroupTests usi…
rheitjoh Apr 26, 2021
b3d734b
Fix standalone tests by not collecting non-public classes
rheitjoh Apr 27, 2021
e9b91b5
Merge pull request #100 from cryptimeleon/fix-scheduled-release-ci
rheitjoh Apr 28, 2021
427a39a
Fix toString methods for debug group stuff
rheitjoh Apr 30, 2021
4bbd6b4
Add missing space in toString
rheitjoh Apr 30, 2021
80ffffe
Merge pull request #101 from cryptimeleon/debug-strings
rheitjoh Apr 30, 2021
ba827ef
Make debug impl classes public again to facilitate better testing of …
rheitjoh Apr 30, 2021
2156c1a
Make ring group impls package-private and start moving inv cost estim…
rheitjoh Apr 30, 2021
5a8c6a1
Add inversion numbers to remaining rings
rheitjoh May 3, 2021
e24ef6c
Make the parameterless constructor test only collect classes that are…
rheitjoh May 3, 2021
2db81af
Make some javadoc improvements
rheitjoh May 3, 2021
2bdc4ba
Merge pull request #98 from cryptimeleon/class-access
rheitjoh May 4, 2021
56d9497
Make StandaloneRepresentationHandler compatible with Android version < S
this-kramer May 19, 2021
6eec432
Add bound check for intValue()
rheitjoh May 20, 2021
18db8e8
Start creating android subproject
rheitjoh May 20, 2021
f7b7f8a
Add android-test subproject that uses root project sources to build f…
rheitjoh May 25, 2021
85900cd
Merge branch 'android' into feature/android-support
rheitjoh May 25, 2021
bd71611
Make test task of android-test subproject work
rheitjoh May 25, 2021
45ad660
Add support for running tests on emulator and make dev workflow run a…
rheitjoh May 25, 2021
e0703f4
Make standard dev ci build only run root project build
rheitjoh May 25, 2021
977c3e0
Update changelog
rheitjoh May 26, 2021
2e7ca76
Merge pull request #105 from cryptimeleon/changelog-update
rheitjoh May 26, 2021
c3e16d4
More concrete isEqualTo return type
JanBobolz May 26, 2021
961bbb2
Merge pull request #106 from cryptimeleon/isEqualToReturn
May 26, 2021
ab73d86
Add android tests to other workflows
rheitjoh May 31, 2021
434157c
Merge pull request #103 from cryptimeleon/feature/android-support
rheitjoh May 31, 2021
eb2bff7
Add DEVELOPER.md file with info on sub-projects
rheitjoh Jun 9, 2021
e99083e
Merge pull request #109 from cryptimeleon/dev-md
rheitjoh Jun 9, 2021
6cfbff8
Move prf stuff over from craco
rheitjoh Jun 23, 2021
3bd1e03
Add package doc and move LongAESRF to aes package
rheitjoh Jun 23, 2021
a77ae12
Update changelog with prf changes
rheitjoh Jun 23, 2021
a3fcf58
Update and rename pub.yaml to tagget_release.yaml
feidens Jun 23, 2021
08e1b99
Update and rename scheduled-release-ci.yaml to scheduled-main-ci.yaml
feidens Jun 23, 2021
790a26c
Update and rename release-ci.yaml to main-ci.yaml
feidens Jun 23, 2021
67f12b8
Merge pull request #111 from cryptimeleon/move-prf
rheitjoh Jun 23, 2021
2c7850c
Update and rename scheduled-main-ci.yaml to scheduled-main-java-ci.yaml
feidens Jun 23, 2021
4957efd
Adapt badges to new names
feidens Jun 23, 2021
0e74b93
Fix for scheduled badge
feidens Jun 23, 2021
a5bb438
Create android.yaml
feidens Jun 23, 2021
c0dbed2
Update dev-ci.yaml
feidens Jun 23, 2021
43dbc33
Move android ci in extra workflow
feidens Jun 23, 2021
3875dfa
Fix for badges with new names
feidens Jun 23, 2021
793b7d4
Add android ci badge
feidens Jun 23, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/android.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Android CI

on:
push:
branches-ignore:
- main
- 'release/**'
# Nightly builds to ensure dependencies don't break anything
schedule:
- cron: '0 0 * * *'

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
android:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Run tests on emulator
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 28
script: ./gradlew android-test:connectedAndroidTest -Pandroid.useAndroidX=true --info
14 changes: 11 additions & 3 deletions .github/workflows/ci.yaml → .github/workflows/dev-ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: Java CI
name: Development Java CI

on: push
on:
push:
branches-ignore:
- main
- 'release/**'
# Nightly builds to ensure dependencies don't break anything
schedule:
- cron: '0 0 * * *'

jobs:
build:
Expand All @@ -12,4 +19,5 @@ jobs:
with:
java-version: 1.8
- name: Build with Gradle
run: ./gradlew build -PcheckoutIfCloned=true
run: ./gradlew :build

28 changes: 28 additions & 0 deletions .github/workflows/main-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Main Java CI

on:
push:
branches:
- main
- 'release/**'

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 -Prelease
android:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Run tests on emulator
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 28
script: ./gradlew android-test:connectedAndroidTest -Prelease -Pandroid.useAndroidX=true --info
20 changes: 20 additions & 0 deletions .github/workflows/scheduled-main-java-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Scheduled Main Java CI

on:
# Nightly builds to ensure dependencies don't break anything
schedule:
- cron: '0 0 * * *'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: main # need to specify branch else it will check out develop
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Gradle
run: ./gradlew :build -Prelease
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: Maven publishing
name: Tagget release

on:
push:
branches:
- main
tags:
- v[1-9]+.[0-9]+.[0-9]+
jobs:
Expand All @@ -16,16 +14,19 @@ jobs:
with:
java-version: 1.8
- name: Publish to the Maven Central Repository
run: ./gradlew publish -PcheckoutIfCloned -Prelease
run: ./gradlew :publish -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 }}
- uses: "marvinpinto/action-automatic-releases@latest"
- name: Github release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
draft: false
files: |
LICENSE
build/libs/*.jar
id: "automatic_releases"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
build/**
android-test/build/**
.gradle/**
out/**
.idea/**
.composite-enable
gradle.properties
local.properties
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,35 @@ 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).

## [Unreleased]

### Added
- Additional operator overload methods added to `ExponentExpr`
- `BasicBilinearGroup` wrappers for the implemented bilinear groups
- Convenience methods for the vector classes
- `square`, `div` and `valueOf` convenience methods for `Zn` and `Zp` classes
- PRF classes from Craco now are part of Math
- `ByteArrayImpl`, a byte array implementation

### Changed
- Renamed "counting" group classes and package to "debug"
- Made supersingular and Barreto-Naehrig implementation classes package-private (except those that are relevant to the user)
- Made internal lazy group classes package-private
- Adjusted some tests to work with the new package-private classes
- Made representation handler classes package-private and moved the classes up a package
- Made ring group impl classes package-private and moved inv and neg cost estimation to the `Ring` interface
- Improved performance of finite field multiplication

### Fixed
- Fixed `decomposeIntoDigits` method of `IntegerRing`

## [1.0.0] - 2021-03-01

### Added
- Initial release


[Unreleased]: https://github.com/cryptimeleon/math/compare/v1.0.0...HEAD
[1.0.0]: https://github.com/cryptimeleon/math/releases/tag/v1.0.0

9 changes: 9 additions & 0 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
This Gradle project consists of two sub-projects.
The root project is the Math library itself.
The `android-test` sub-project is only used to run the library's tests on Android.
For that purpose it contains an Android-specific build file.

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.
For example, instead of `./gradlew build` use `./gradlew :build` to build the Math library.
The former will fail since the android sub-project is not configured to be actually buildable.
See [here](https://docs.gradle.org/current/userguide/intro_multi_project_builds.html) for more information on how multi-project builds work.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
![Build Status](https://github.com/cryptimeleon/math/workflows/Java%20CI/badge.svg)
![Build Status](https://github.com/cryptimeleon/math/workflows/Development%20Java%20CI/badge.svg)
![Build Status](https://github.com/cryptimeleon/math/workflows/Main%20Java%20CI/badge.svg)
![Build Status](https://github.com/cryptimeleon/math/workflows/Scheduled%20Main%20Java%20CI/badge.svg)
![Build Status](https://github.com/cryptimeleon/math/workflows/Android%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.
It implements basics such as mathematical groups, rings and fields, e.g. Zn, as well as implementations of cryptographic pairings.
Furthermore, it offers 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.**
Expand Down
97 changes: 97 additions & 0 deletions android-test/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
buildscript {
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
classpath("de.mannodermaus.gradle.plugins:android-junit5:1.7.1.1")
}
}

apply plugin: 'com.android.library'
apply plugin: "de.mannodermaus.android-junit5"

android {
compileSdkVersion 30
defaultConfig {
minSdkVersion 28
targetSdkVersion 30

testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
// JUnit 5 support for instrumentation tests
testInstrumentationRunnerArgument "runnerBuilder", "de.mannodermaus.junit5.AndroidJUnit5Builder"
}

// make the android-test subproject just reuse the math stuff
sourceSets {
main {
java.srcDirs = ["../src/main/java"]
}

// unit tests. Run via test task
test {
java.srcDirs = ["../src/test/java"]
}

androidTest {
java.srcDirs = ["../src/test/java"]
}
}

compileOptions {
setSourceCompatibility(JavaVersion.VERSION_1_8)
setTargetCompatibility(JavaVersion.VERSION_1_8)
}

testOptions {
unitTests {
all {
useJUnitPlatform()
maxParallelForks 4
//we want display the following test events
testLogging {
events "PASSED", "STARTED", "FAILED", "SKIPPED"
}
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
def startItem = '| ', endItem = ' |'
def repeatLength = startItem.length() + output.length() + endItem.length()
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
}
}
}
}
}
}

repositories {
mavenCentral()
google()
}

dependencies {
implementation group: 'com.googlecode.json-simple', name: 'json-simple', version:'1.1'
implementation group: 'org.reflections', name: 'reflections', version:'0.9.10'

// (Required) Writing and executing Unit Tests on the JUnit Platform
testImplementation "org.junit.jupiter:junit-jupiter-api:5.7.1"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.7.1"

// (Optional) If you need "Parameterized Tests"
testImplementation "org.junit.jupiter:junit-jupiter-params:5.7.1"

// (Optional) If you also have JUnit 4-based tests
testImplementation "junit:junit:4.13"
testRuntimeOnly "org.junit.vintage:junit-vintage-engine:5.7.1"

// Instrumentation test stuff
androidTestImplementation "androidx.test:runner:1.3.0"
androidTestImplementation "org.junit.jupiter:junit-jupiter-api:5.7.1"
androidTestImplementation "org.junit.jupiter:junit-jupiter-params:5.7.1"

androidTestImplementation "de.mannodermaus.junit5:android-test-core:1.2.2"
androidTestRuntimeOnly "de.mannodermaus.junit5:android-test-runner:1.2.2"
}
4 changes: 4 additions & 0 deletions android-test/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.cryptimeleon.math">
</manifest>
7 changes: 1 addition & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,17 @@ plugins {
group = 'org.cryptimeleon'
archivesBaseName = project.name
boolean isRelease = project.hasProperty("release")
version = '1.0.0' + (isRelease ? "" : "-SNAPSHOT")

version = '2.0.0' + (isRelease ? "" : "-SNAPSHOT")

sourceCompatibility = 1.8
targetCompatibility = 1.8
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}



repositories {
mavenLocal()
mavenCentral()
jcenter()
}

dependencies {
Expand All @@ -44,7 +40,6 @@ dependencies {
)
}


test {
useJUnitPlatform()
maxParallelForks 4
Expand Down
2 changes: 2 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
rootProject.name = 'math'

include 'android-test'
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public ExponentEqualityExpr(ExponentExpr lhs, ExponentExpr rhs) {
}

@Override
public BooleanExpression substitute(Substitution substitutions) {
public ExponentEqualityExpr substitute(Substitution substitutions) {
return lhs.substitute(substitutions).isEqualTo(rhs.substitute(substitutions));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public Group getGroup() {
}

@Override
public BooleanExpression substitute(Substitution substitutions) {
public GroupEqualityExpr substitute(Substitution substitutions) {
return lhs.substitute(substitutions).isEqualTo(rhs.substitute(substitutions));
}

Expand Down
Loading