|0.1.0||Apr 12, 2022|
#595 in Cryptography
Proof of Concept implementation. This crate is ongoing work, has not been audited, and API is by no means final. Do not use.
atms implements Ad-Hoc Threshold MultiSignatures (ATMS) implementation using
multi signature scheme as described in Section 5.2 of the
by Gazi, Kiayias and Zindros. Elliptic curve cryptography, and basic
signature procedures are performed using the
library by supranational which implements BLS signatures over curve
The library exposes a C API for facilitating its usage with other languages.
Note: For MacOS I made it work by adding
-std=c++<VERSION> to the
clang command below, after installing
<VERSION> needs to be 11 or higher.
First, one needs to compile the library running:
cargo build --release
Then, we need to build the header files using
cbindgen. For this, first install
cargo install cbindgen
and then build the header file by running the following command from the parent directory (nightly is required):
rustup run nightly cbindgen ./ --config cbindgen.toml --crate atms --output target/include/atms.h
For running rust tests, simply run (recommended use of
--release, otherwise it takes a while):
cargo test --release
For the c-tests, we first build the test executable. First enter the
c-tests folder, and then run:
clang -x c++ tests.c stms.c atms.c -g -o tests -L ../target/release -lmithril -lstdc++ -lgtest -lgtest_main
NOTE: Do not use g++, it does compile but leads to segfault when running the test.
To execute the tests:
./tests [==========] Running 5 tests from 2 test suites. [----------] Global test environment set-up. [----------] 3 tests from atms [ RUN ] atms.produceAndVerifyAggregateSignature [ OK ] atms.produceAndVerifyAggregateSignature (27 ms) [ RUN ] atms.testingErrors [ OK ] atms.testingErrors (29 ms) [ RUN ] atms.serdeAtms [ OK ] atms.serdeAtms (14 ms) [----------] 3 tests from atms (71 ms total) [----------] 2 tests from multisig [ RUN ] multisig.produceAndVerifyMultiSignature [ OK ] multisig.produceAndVerifyMultiSignature (2 ms) [ RUN ] multisig.serdeMultiSignature [ OK ] multisig.serdeMultiSignature (2 ms) [----------] 2 tests from multisig (4 ms total) [----------] Global test environment tear-down [==========] 5 tests from 2 test suites ran. (76 ms total) [ PASSED ] 5 tests.