A faster implementation of ECC-based DID intersection than SecureUnionID. The elliptic curve behind is chosen to be bn254 (aka Fp254BNb).
First, you should build and install mcl into system path
git clone https://github.com/herumi/mcl.git --depth 1 --branch v1.76
cd mcl
mkdir build
cd build
cmake ..
make
sudo make install
Then follow language guides below:
mkdir build
cd build
cmake ..
make test
cd go && go test SecureID -tags bn256
mvn clean test
python secure_id_test.py
Checkout the unit tests for API usage.
G: base point, defined by curve
r: random number, generated by PublicKey holder
PublicKey: Q = d*G | SecretKey: d | |
---|---|---|
hash | P = hash_to_curve(msg) | P = hash_to_curve(msg) |
sign1 | S1 = d*P | |
blind | B = P + r*G | |
sign2 | S2 = d*B | |
unblind | U = S2 - r*Q |
U = d*(P + rG) - rd*G = S1
Apple M1 Pro
BenchmarkSign1-10 17118 68549 ns/op
Benchmark Mode Cnt Score Error Units
SecureIDBenchmark.bmSign1 avgt 5 67765.119 ± 1689.184 ns/op