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

Remove Project Lombok dependency #9

Merged
merged 9 commits into from
Nov 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 2 additions & 14 deletions .github/workflows/publish-and-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,13 @@ jobs:
id: maven-project
draft-release:
runs-on: ubuntu-20.04
needs: [prepare]
needs: [ prepare ]
env:
VERSION: "${{ needs.prepare.outputs.VERSION }}"
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Retrieve license obligation resources
run: |
cd 3RD-PARTY-LICENSES
find . -maxdepth 1 -type d -not -path . | zip -r@ ${GITHUB_REPOSITORY#*/}-3rd-party-copyrights
find . -iname origin.src | \
awk '{ \
split($0,b,"/"); \
system("xargs < " $0 " curl --create-dirs -Lo ./sources/" b[2] ".zip " $2)}' && \
find -regex './sources$' | awk '{system("zip -jr ./${GITHUB_REPOSITORY#*/}-3rd-party-sources.zip " $0)}'
mkdir -p ../license-obligations && mv `find . -regex "^./${GITHUB_REPOSITORY#*/}-3rd-party-.*.zip$"` ../license-obligations/
cd -
- name: Generate change log
run: |
chmod +x .github/scripts/generate-changelog.sh
Expand All @@ -62,10 +51,9 @@ jobs:
tag: ${{ env.VERSION }}
draft: true
bodyFile: /tmp/cs.repository-changelog.${{ env.VERSION }}
artifacts: "license-obligations/*"
publish:
runs-on: ubuntu-20.04
needs: [prepare,draft-release]
needs: [ prepare,draft-release ]
env:
VERSION: "${{ needs.prepare.outputs.VERSION }}"
steps:
Expand Down
104 changes: 0 additions & 104 deletions 3RD-PARTY-LICENSES/org.projectlombok_lombok/LICENSE

This file was deleted.

17 changes: 0 additions & 17 deletions 3RD-PARTY-LICENSES/sbom.xml

This file was deleted.

6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ This project provides utilities for using
Carbyne Stack *MP-SPDZ Integration Utilities* is open-sourced under the Apache
License 2.0. See the [LICENSE](LICENSE) file for details.

### 3rd Party Licenses

For information on how license obligations for 3rd party OSS dependencies are
fulfilled see the [README](https://github.com/carbynestack/carbynestack) file of
the Carbyne Stack repository.

## Contributing

Please see the Carbyne Stack
Expand Down
7 changes: 0 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,9 @@
<maven-license-plugin.version>2.0.0</maven-license-plugin.version>

<!-- External dependency versions -->
<lombok.version>1.18.20</lombok.version>
<junit.version>4.13.2</junit.version>
</properties>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>

<!--Test dependencies-->
<dependency>
<groupId>junit</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,80 @@
*/
package io.carbynestack.mpspdz.integration;

import static java.util.Objects.requireNonNull;

import java.math.BigInteger;
import java.util.Arrays;
import lombok.NonNull;
import lombok.Value;

/** Enables conversion from BigInteger to the MP-SPDZ internal representation and vice versa. */
@Value(staticConstructor = "of")
public class MpSpdzIntegrationUtils {

/** Modulus N as used by the MP-SPDZ implementation */
@NonNull BigInteger prime;

/** Auxiliary modulus R as used by the MP-SPDZ implementation */
@NonNull BigInteger r;

/** Multiplicative inverse for the auxiliary modulus R as used by the MP-SPDZ implementation */
@NonNull BigInteger rInv;

public final class MpSpdzIntegrationUtils {
/** The size of a limb in the MP-SPDZ runtime. */
public static final int LIMB_WIDTH = 8;

/** The size of a word in the MP-SPDZ runtime. */
public static final int WORD_WIDTH = 2 * LIMB_WIDTH;

/** The size of a share (value, MAC) in the MP-SPDZ runtime. Equals two times the word width. */
public static final int SHARE_WIDTH = 2 * WORD_WIDTH;
/** Modulus N as used by the MP-SPDZ implementation */
private final BigInteger prime;
/** Auxiliary modulus R as used by the MP-SPDZ implementation */
private final BigInteger r;
/** Multiplicative inverse for the auxiliary modulus R as used by the MP-SPDZ implementation */
private final BigInteger rInv;

/**
* Constructs an instance of {@code MpSpdzIntegrationUtils} using prime, r and rInv.
*
* @param prime Modulus N as used by the MP-SPDZ implementation
* @param r Auxiliary modulus R as used by the MP-SPDZ implementation
* @param rInv Multiplicative inverse for the auxiliary modulus R as used by the MP-SPDZ
* implementation
*/
private MpSpdzIntegrationUtils(BigInteger prime, BigInteger r, BigInteger rInv) {
this.prime = requireNonNull(prime);
this.r = requireNonNull(r);
this.rInv = requireNonNull(rInv);
}

/**
* Constructs an instance of {@code MpSpdzIntegrationUtils} using prime, r and rInv.
*
* @param prime Modulus N as used by the MP-SPDZ implementation
* @param r Auxiliary modulus R as used by the MP-SPDZ implementation
* @param rInv Multiplicative inverse for the auxiliary modulus R as used by the MP-SPDZ
* implementation
* @return an instance of {@code MpSpdzIntegrationUtils}
*/
public static MpSpdzIntegrationUtils of(BigInteger prime, BigInteger r, BigInteger rInv) {
return new MpSpdzIntegrationUtils(prime, r, rInv);
}

/**
* Returns Modulus N as used by the MP-SPDZ implementation.
*
* @return {@code this.prime}
*/
public BigInteger getPrime() {
return prime;
}

/**
* Returns Auxiliary modulus R as used by the MP-SPDZ implementation.
*
* @return {@code this.r}
*/
public BigInteger getR() {
return r;
}

/**
* Returns Multiplicative inverse for the auxiliary modulus R as used by the MP-SPDZ
* implementation.
*
* @return {@code this.rInv}
*/
public BigInteger getRInv() {
return rInv;
}

/**
* Converts a number given as a BigInteger to the MP-SPDZ internal representation.
Expand Down