Skip to content

Commit

Permalink
Merge branch 'release/v1.0.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
feidens committed Mar 5, 2021
2 parents d7e1395 + b806147 commit 49e2aa3
Show file tree
Hide file tree
Showing 8 changed files with 187 additions and 30 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/ci.yaml

This file was deleted.

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

on:
push:
branches-ignore:
- main
- 'release/**'
pull_request:
branches:
- develop
# 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 -PcheckoutIfCloned
30 changes: 30 additions & 0 deletions .github/workflows/pub.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publishing

on:
push:
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 }}
- name: Github release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
LICENSE
build/libs/*.jar
26 changes: 26 additions & 0 deletions .github/workflows/release-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release Java CI

on:
push:
branches:
- main
- 'release/**'
pull_request:
branches:
- 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 -PcheckoutIfCloned -Prelease
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
![Build Status](/~https://github.com/cryptimeleon/predenc/workflows/Java%20CI/badge.svg)
![Build Status](/~https://github.com/cryptimeleon/predenc/workflows/Development%20Java%20CI/badge.svg)
![Build Status](/~https://github.com/cryptimeleon/predenc/workflows/Release%20Java%20CI/badge.svg)
# Predenc

The Cryptimeleon Predenc project contains various predicate encryption implementations such as attribute-based encryption or identity-based encryption.
Expand Down
96 changes: 94 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
plugins {
id 'java-library'
id 'maven-publish'
id 'signing'
}

group 'org.cryptimeleon'
archivesBaseName = project.name
boolean isRelease = project.hasProperty("release")
version = '1.0.0' + (isRelease ? "" : "-SNAPSHOT")

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


repositories {
mavenLocal()
mavenCentral()
Expand Down Expand Up @@ -69,16 +77,100 @@ test {
}
}

task javadocLink(type: Javadoc) {
task javadocLatex(type: Javadoc) {
source = sourceSets.main.allJava
classpath = sourceSets.main.runtimeClasspath
// link to math and craco javadocs
options {
links "https://javadoc.io/doc/org.cryptimeleon/math/" + mathVersionNoSuffix, "https://javadoc.io/doc/org.cryptimeleon/craco/" + cracoVersionNoSuffix
}
// enable latex rendering via mathjax
options.addBooleanOption("-allow-script-in-comments", true)
options.header = "<script type\"text/javascript&\" src=\"" +
"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?" +
"config=TeX-MML-AM_CHTML\"></script>"
}

task javadocJar(type: Jar, dependsOn: javadocLink) {
task javadocJar(type: Jar, dependsOn: javadocLatex) {
from javadoc.destinationDir
archiveClassifier.set('javadoc')
}

task sourcesJar(type: Jar) {
from sourceSets.main.allJava
archiveClassifier.set('sources')
}

artifacts {
archives javadocJar
archives sourcesJar
}

java {
withJavadocJar()
withSourcesJar()
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
artifacts {
archives javadocJar, sourcesJar
}

pom {
name = 'Predenc'
url = 'https://cryptimeleon.org'
description = 'The Cryptimeleon Predenc project contains various predicate encryption ' +
'implementations such as attribute-based encryption or identity-based encryption. ' +
'Furthermore, it contains key encapsulation mechanisms based on predicate encryption schemes.'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'cryptimeleon-dev'
name = 'cryptimeleon Developers'
email = 'dev@cryptimeleon.org'
}
}
scm {
connection = 'scm:git:git://github.com/cryptimeleon/predenc.git'
developerConnection = 'scm:git:/~https://github.com/cryptimeleon/predenc.git'
url = '/~https://github.com/cryptimeleon/predenc/'
}
}
}
}
repositories {
maven {
credentials {
username = System.getenv("OSSRH_USERNAME")
password = System.getenv("OSSRH_TOKEN")
}
name = 'OSSRH'
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
url = version.endsWith('SNAPSHOT') ? '' : releasesRepoUrl
}
}
}

signing {
required(project.hasProperty("release"))
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}
14 changes: 6 additions & 8 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,18 @@ if (!hasProperty("release")) {
+ "' exists remotely but not locally. Please check it out yourself before building.")
}
} else {
println(msgPrefix + libPrefix + ": Branch '" + branchThis.getName() + "' does not exist remotely. Using main.")
if (grgitLib.branch.current().getName() == "main") {
println(msgPrefix + libPrefix + ": Branch main is checked out already. Using it.")
println(msgPrefix + libPrefix + ": Branch '" + branchThis.getName() + "' does not exist remotely. Using develop.")
if (grgitLib.branch.current().getName() == "develop") {
println(msgPrefix + libPrefix + ": Branch develop is checked out already. Using it.")
} else {
if (hasProperty("checkoutIfCloned") && cloned) {
println(msgPrefix + libPrefix + ": Branch main is not checked out. "
println(msgPrefix + libPrefix + ": Branch develop is not checked out. "
+ "'checkoutIfCloned' is set. Automatically checking it out.")
grgitLib.checkout {
branch = branchThis.getName()
startPoint = "origin/" + branchThis.getName()
createBranch = true
branch = "develop"
}
} else {
throw new GradleException(msgPrefix + libPrefix + ": Branch main exists but is not checked out. "
throw new GradleException(msgPrefix + libPrefix + ": Branch develop exists but is not checked out. "
+ "Please check it out yourself before building.")
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/cryptimeleon/predenc/abe/ibe/FullIdent.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public FullIdent(Representation repr) {
}

/**
* Hash function: {0,1}^* -> G_1
* Hash function: \(\{0,1\}^* \rightarrow \mathbb{G}_1\)
*
* @param data
* @return group element
Expand All @@ -59,7 +59,7 @@ protected GroupElement H1(byte[] data) {
}

/**
* Hash function: G_T -> {0,1}^n
* Hash function: \(\mathbb{G}_T \rightarrow \{0,1\}^n\)
*
* @param groupElement target group element
* @return
Expand All @@ -70,7 +70,7 @@ private byte[] H2(GroupElement groupElement) {
}

/**
* Hash function: {0,1}^n x {0,1}^n -> Z_p
* Hash function: \(\{0,1\}^n \times \{0,1\}^n \rightarrow \mathbb{Z}_p\)
*
* @param s1
* @param s2
Expand All @@ -87,7 +87,7 @@ private BigInteger H3(byte[] s1, byte[] s2) {
}

/**
* Hash function {0,1}^n -> {0,1}^n
* Hash function \(\{0,1\}^n \rightarrow \{0,1\}^n\)
*
* @param s
* @return
Expand Down

0 comments on commit 49e2aa3

Please sign in to comment.