This repository was archived by the owner on Mar 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Michael Lodder <[email protected]>
- Loading branch information
1 parent
af794c2
commit 2886620
Showing
47 changed files
with
5,665 additions
and
3,648 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ build | |
.venv | ||
.cache | ||
.DS_Store | ||
Cargo.lock | ||
Podfile.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Contributing to Hyperledger Ursa | ||
|
||
Hyperledger Ursa is Apache 2.0 licensed and accepts contributions via | ||
[GitHub](https://github.com/hyperledger-labs/crypto-lib) pull requests. | ||
|
||
Please see | ||
[Contributing](docs/source/community/contributing.rst) | ||
in the Ursa documentation for information on how to contribute and the guidelines for contributions. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,103 +1,129 @@ | ||
# Lab Name | ||
crypto-lib | ||
|
||
# Short Description | ||
A lab for experimentation on creating shared cryptography modules for cross-project collaboration | ||
|
||
# Scope of Lab | ||
The purpose of this lab is to serve as an initial launching point for what will hopefully become a shared Hyperledger cryptography library. We aim to use this lab to set up a code base and experiment with integrating cryptographic protocols between projects. | ||
|
||
See: https://docs.google.com/document/d/1JtFT5L-82egj6shgGXzTsNAg6_UHuMheKfsst6NS_Xo/edit?usp=sharing | ||
for more details. | ||
|
||
# Initial Committers | ||
- hartm | ||
- mikelodder7 | ||
- lovesh | ||
- vaporos | ||
|
||
# Sponsor | ||
Hart Montgomery | ||
|
||
|
||
## Before you Continue | ||
|
||
If you haven't done so already, please visit the main resource for all things "Indy" to get acquainted with the code base, helpful resources, and up-to-date information: [Hyperledger Wiki-Indy](https://wiki.hyperledger.org/projects/indy). | ||
|
||
# Indy Crypto | ||
# Crypto Lib | ||
|
||
This is the shared crypto library for [Hyperledger Indy](https://www.hyperledger.org/projects) components. | ||
This is the shared crypto library for [Hyperledger](https://www.hyperledger.org/projects) components. | ||
|
||
[Hyperledger Indy](https://www.hyperledger.org/projects) provides a distributed-ledger-based foundation for [self-sovereign identity](https://sovrin.org). | ||
|
||
The major artifacts of the Indy Crypto are: | ||
[Hyperledger](https://www.hyperledger.org/projects) provides a distributed-ledger-based foundation for [self-sovereign identity](https://sovrin.org). | ||
|
||
The major artifacts of the Crypto Lib are: | ||
* С-callable library interface | ||
* Rust сrate | ||
* Python wrapper | ||
|
||
All bugs, stories, and backlog for this project are managed through [Hyperledger's Jira](https://jira.hyperledger.org) | ||
in project IS (note that regular Indy tickets are in the INDY project instead...). Also, join | ||
us on [Jira's Rocket.Chat](chat.hyperledger.org) at #indy-sdk to discuss. | ||
|
||
## Building Indy Crypto | ||
|
||
## Ubuntu 16.04 | ||
## Building Crypto-Lib | ||
|
||
1. Install xcode command line tools | ||
``` | ||
xcode-select --install | ||
``` | ||
1. Install Rust and rustup (https://www.rust-lang.org/install.html). | ||
1. Install pre-requirements: | ||
|
||
*For Ubuntu 16.04* | ||
|
||
```bash | ||
apt-get update && \ | ||
apt-get install -y \ | ||
build-essential \ | ||
pkg-config \ | ||
cmake \ | ||
libssl-dev | ||
``` | ||
|
||
*For Windows* | ||
|
||
* Download the prebuilt dependencies [here](https://repo.sovrin.org/windows/libhl_crypto/deps/) | ||
* Extract them into the folder _C:\BIN\x64_. Note it really doesn't matter where you put these as long as you | ||
remember where so you can set the environment variables to this path | ||
* Point path to this directory using environment variables: | ||
* set OPENSSL_DIR=C:\BIN\x64 | ||
* set PATH=C:\BIN\x64\lib;%PATH% | ||
1. Install Libsodium | ||
- For Mac OS X | ||
``` | ||
brew install libsodium | ||
or to build it from scratch | ||
brew install autoconf | ||
brew install automake | ||
git clone [email protected]:jedisct1/libsodium.git | ||
cd libsodium | ||
./autoconf | ||
./configure | ||
make | ||
sudo make install | ||
``` | ||
1. Checkout and build the library: | ||
|
||
```bash | ||
git clone https://github.com/hyperledger/indy-crypto.git | ||
cd ./indy-crypto/libindy-crypto | ||
``` | ||
git clone https://github.com/hyperledger-labs/crypto-lib.git | ||
cd ./crypto-lib/libhl-crypto | ||
cargo build | ||
cd .. | ||
``` | ||
1. Run tests | ||
```bash | ||
cd libindy-crypto | ||
``` | ||
cd libhl-crypto | ||
cargo test | ||
``` | ||
**Note:** | ||
By default `cargo build` produce debug artifacts with a large amount of run-time checks. | ||
It's good for development, but this build can be in 100+ times slower for some math calculation. | ||
If you would like to analyse CPU performance of libindy-crypto for your use case, you have to use release artifacts (`cargo build --release`). | ||
|
||
## API Documentation | ||
### Windows build dependency | ||
System OpenSSL library is required. | ||
- Download the prebuilt dependencies [here](https://repo.sovrin.org/windows/libindy_crypto/deps/) | ||
- Extract them into the folder _C:\BIN\x64_ | ||
> It really doesn't matter where you put these as long as you remember where so you can set | ||
> the environment variables to this path | ||
- Point path to this directory using environment variables: | ||
- set INDY_CRYPTO_PREBUILT_DEPS_DIR=C:\BIN\x64 | ||
- set OPENSSL_DIR=C:\BIN\x64 | ||
|
||
## Documentation | ||
Project documentation is available via sphinx. | ||
Install sphinx: | ||
``` | ||
pip install -U Sphinx | ||
``` | ||
Build the project docs: | ||
``` | ||
cd docs/ | ||
make html | ||
``` | ||
|
||
API documentation is now available as rust doc in code. See: | ||
|
||
* C API | ||
* [BLS](libindy-crypto/src/ffi/bls.rs) | ||
* [CL](libindy-crypto/src/ffi/cl) | ||
- [BLS](libhl-crypto/src/ffi/bls.rs) | ||
- [CL](libhl-crypto/src/ffi/cl) | ||
* Rust API | ||
* [BLS](libindy-crypto/src/bls/mod.rs) | ||
* [CL](libindy-crypto/src/cl) | ||
|
||
## Wrappers documentation | ||
|
||
* [Python](wrappers/python/README.md) | ||
* [JavaScript](wrappers/javascript/README.md) | ||
- [BLS](libhl-crypto/src/bls/mod.rs) | ||
- [CL](libhl-crypto/src/cl) | ||
|
||
## Binaries | ||
|
||
Note: Binaries creation is in progress now!!! | ||
|
||
Builded binaries can be downloaded from [https://repo.sovrin.org](https://repo.sovrin.org): | ||
|
||
Builded binaries can be downloaded from https://repo.sovrin.org: | ||
* sdk/lib/apt/xenial/{master,stable,rc} - Ubuntu deb packages | ||
* windows/libhl_crypto/{master,stable,rc} - Windows zip-archive with all required DLLs (include libindy itself) and headers | ||
* ios/libhl_crypto/stable/ - Pods for iOS | ||
* rhel/libhl_crypto/{master,stable,rc} - RHEL rpms | ||
|
||
Also Ubundu deb packages can be installed from APT repository: | ||
* windows/libindy_crypto/{master,stable,rc} - Windows zip-archive with all required DLLs (include libindy itself) and headers | ||
* ios/libindy_crypto/stable/ - Pods for iOS | ||
* rhel/libindy_crypto/{master,stable,rc} - RHEL rpms | ||
|
||
```bash | ||
Also Ubuntu deb packages can be installed from APT repository: | ||
``` | ||
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68DB5E88 | ||
sudo add-apt-repository "deb https://repo.sovrin.org/sdk/deb xenial stable" | ||
sudo apt-get update | ||
sudo apt-get install -y libindy-crypto | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line. | ||
SPHINXOPTS = | ||
SPHINXBUILD = sphinx-build | ||
SOURCEDIR = source | ||
BUILDDIR = build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
********* | ||
Community | ||
********* | ||
|
||
Welcome to the Ursa community! | ||
|
||
For help topics, see "Joining the Discussion" linked below. | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
community/join_the_discussion | ||
community/issue_tracking | ||
community/contributing | ||
community/code_of_conduct | ||
|
||
|
||
.. Licensed under Creative Commons Attribution 4.0 International License | ||
.. https://creativecommons.org/licenses/by/4.0/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
Code of Conduct | ||
=============== | ||
|
||
When participating, please be respectful and courteous. | ||
|
||
Hyperledger Ursa uses the `Hyperledger Project Code of Conduct | ||
<https://wiki.hyperledger.org/community/hyperledger-project-code-of-conduct>`_. | ||
|
||
.. Licensed under Creative Commons Attribution 4.0 International License | ||
.. https://creativecommons.org/licenses/by/4.0/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
------------ | ||
Contributing | ||
------------ | ||
|
||
========================================== | ||
Ways to Contribute to Hyperledger Ursa | ||
========================================== | ||
|
||
Contributions from the development community help improve the capabilities of | ||
Hyperledger Ursa. These contributions are the most effective way to | ||
make a positive impact on the project. | ||
|
||
Ways you can contribute: | ||
|
||
* Bugs or issues: Report problems or defects found when working with Ursa | ||
* Core features and enhancements: Provide expanded capabilities or optimizations | ||
* Documentation: Improve existing documentation or create new information | ||
* Tests: Add functional, performance, or scalability tests | ||
|
||
Hyperledger Ursa issues can be found in :ref:`jira`. Any unassigned items | ||
are probably still open. When in doubt, ask on RocketChat about | ||
a specific JIRA issue (see :doc:`join_the_discussion`). | ||
|
||
================== | ||
The Commit Process | ||
================== | ||
|
||
Hyperledger Ursa is Apache 2.0 licensed and accepts contributions | ||
via `GitHub <https://github.com/hyperledger-labs/crypto-lib>`_ | ||
pull requests. When contributing code, please follow these guidelines: | ||
|
||
* Fork the repository and make your changes in a feature branch | ||
* Include unit and integration tests for any new features and updates | ||
to existing tests | ||
* Ensure that the unit and integration tests run successfully. | ||
|
||
**Pull Request Guidelines** | ||
|
||
A pull request can contain a single commit or multiple commits. The most | ||
important guideline is that a single commit should map to a single fix or | ||
enhancement. Here are some example scenarios: | ||
|
||
* If a pull request adds a feature but also fixes two bugs, the pull | ||
request should have three commits: one commit for the feature change and | ||
two commits for the bug fixes. | ||
* If a PR is opened with five commits that contain changes to fix a single | ||
issue, the PR should be rebased to a single commit. | ||
* If a PR is opened with several commits, where the first commit fixes one issue | ||
and the rest fix a separate issue, the PR should be rebased to two | ||
commits (one for each issue). | ||
|
||
**Important:** | ||
Your pull request should be rebased against the current master branch. Do | ||
not merge the current master branch in with your topic branch. Do not use the | ||
Update Branch button provided by GitHub on the pull request page. | ||
|
||
**Commit Messages** | ||
|
||
Commit messages should follow common Git conventions, such as using the | ||
imperative mood, separate subject lines, and a line length of 72 characters. | ||
These rules are well documented in `Chris Beam's blog post | ||
<https://chris.beams.io/posts/git-commit/#seven-rules>`_. | ||
|
||
**Signed-off-by** | ||
|
||
Each commit must include a "Signed-off-by" line in the commit message | ||
(``git commit -s``). This sign-off indicates that you agree the commit satisfies | ||
the `Developer Certificate of Origin (DCO) <http://developercertificate.org/>`_. | ||
|
||
**Commit Email Address** | ||
|
||
Your commit email address must match your GitHub email address. For more | ||
information, see | ||
https://help.github.com/articles/setting-your-commit-email-address-in-git/ | ||
|
||
**Important GitHub Requirements** | ||
|
||
A pull request cannot merged until it has passed these status checks: | ||
|
||
* The build must pass on Jenkins | ||
* The PR must be approved by at least two maintainers without any | ||
outstanding requests for changes | ||
* Any non-black-box use of an algorithm must include a theoretical maintainer | ||
as one of the two reviewers. | ||
|
||
**Integrating GitHub Commits with JIRA** | ||
|
||
You can link JIRA issues to your commits, which will integrate | ||
developer activity with the associated issue. JIRA uses the issue key to | ||
associate the commit with the issue, so that the commit can be summarized in the | ||
development panel for the JIRA issue. | ||
|
||
When you make a commit, add the JIRA issue key to the end of the commit message | ||
or to the branch name. Either method should integrate your commit with the JIRA | ||
issue that it references. | ||
|
||
.. Licensed under Creative Commons Attribution 4.0 International License | ||
.. https://creativecommons.org/licenses/by/4.0/ |
Oops, something went wrong.