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

Organize Hedera-Cryptography Repository and create necessary gradle modules and plugins #13324

Closed
mxtartaglia-sl opened this issue May 15, 2024 · 1 comment
Assignees
Labels
Epic A body of work that can be broken down into specific tasks. Platform Tickets pertaining to the platform

Comments

@mxtartaglia-sl
Copy link
Contributor

mxtartaglia-sl commented May 15, 2024

We need to assemble the structure of repository: /github.com/hashgraph/hedera-cryptography
This is a separate repository for hosting cryptography-related libraries. It is necessary to facilitate our build process, which includes Rust libraries. It also provides independent release cycles between consensus and block node codes.

Its current content should be replaced by the following structure:
img_6

swirlds-native-support: Gradle module that enables loading into memory compiled native libraries to be used with JNI.
swirlds-crypto-signatures: Gradle module for the Bilinear Pairings Signature Library.
swirlds-crypto-pairings-api: Gradle module for the Bilinear Pairings API. Minimizes the impact of adding or removing implementations.
swirlds-crypto-altbn128: Gradle module that will implement the Bilinear Pairings API using alt-128 elliptic curve. That curve has been chosen due to EVM support. The arkworks rust library will provide the underlying cryptography implementation. The module will include Java and Rust codes that will be compiled for all possible system architectures and distributed in a jar under a predefined structure.

Build logic should be similar to hedera-services except for swirlds-crypto-altbn128

swirlds-crypto-altbn128

This module will be a multilanguage module following the structure:

 swirlds-cryptography-alt128
swirlds-crypto-pairings-altbn128
    ├── main
    │   ├── java
    │   │   └── **
    │   └── rust
    │   │   └── **
    └── test
        └── java
            └── **
Generated resources folder structure

Rust code will be compiled first and the build process will create the following folder structure where binaries files will be placed and then distributed.
They will be arranged by platform identifier, as returned by System.getProperty("os.name") and System.getProperty("os.arch").

resources/software
    ├── LIBRARY_VERSION (Contains the version number or information for the original native library)
    ├── darwin
    │   ├── amd64
    │   │   ├── native_lib.dylib **
    │   │   └── jni_bindings.dylib
    │   └── arm64
    │   │   ├── native_lib.dylib **
    │   │   └── jni_bindings.dylib
    ├── linux
    │   ├── amd64
    │   │   ├── native_lib.so **
    │   │   └── jni_bindings.so
    │   ├── arm
    │   │   ├── native_lib.so **
    │   │   └── jni_bindings.so
    │   └── arm64
    │   │   ├── native_lib.so **
    │   │   └── jni_bindings.so
    └── windows
        └── amd64
            ├── native_lib.dll **
            └── jni_bindings.dll

** NOTE: native_lib is only required if not statically linked to the native JNI binding library
@mxtartaglia-sl mxtartaglia-sl self-assigned this May 15, 2024
@poulok poulok changed the title Move the POC to its own gradle module Move the Hedera Crypto Module API to its own gradle module May 16, 2024
@mxtartaglia-sl mxtartaglia-sl added this to the v0.51 milestone May 23, 2024
@poulok poulok added the Platform Tickets pertaining to the platform label Jun 4, 2024
@mxtartaglia-sl mxtartaglia-sl changed the title Move the Hedera Crypto Module API to its own gradle module Create Hedera Crypto Repository and necessary gradle modules Jun 7, 2024
@mxtartaglia-sl mxtartaglia-sl changed the title Create Hedera Crypto Repository and necessary gradle modules Organize Hedera-Cryptography Repository and create necessary gradle modules Jun 25, 2024
@mxtartaglia-sl mxtartaglia-sl added the Epic A body of work that can be broken down into specific tasks. label Jul 1, 2024
@mxtartaglia-sl mxtartaglia-sl changed the title Organize Hedera-Cryptography Repository and create necessary gradle modules Organize Hedera-Cryptography Repository and create necessary gradle modules and plugins Jul 1, 2024
@poulok poulok removed this from the v0.51 milestone Aug 15, 2024
@jjohannes
Copy link
Collaborator

Closing, as the task is completed and follow up work is tracked in separate issues already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Epic A body of work that can be broken down into specific tasks. Platform Tickets pertaining to the platform
Projects
None yet
Development

No branches or pull requests

4 participants