status-go/vendor/github.com/kilic/bls12-381
Andrea Maria Piana 4d15ae8a85 Upgrade to go 1.18 2022-05-11 12:39:54 +01:00
..
.gitignore Feature/key compression (#1990) 2020-06-23 11:47:17 +01:00
LICENSE Feature/key compression (#1990) 2020-06-23 11:47:17 +01:00
README.md Feature/key compression (#1990) 2020-06-23 11:47:17 +01:00
arithmetic_decl.go Feature/key compression (#1990) 2020-06-23 11:47:17 +01:00
arithmetic_fallback.go Feature/key compression (#1990) 2020-06-23 11:47:17 +01:00
arithmetic_x86.s Feature/key compression (#1990) 2020-06-23 11:47:17 +01:00
bls12_381.go Feature/key compression (#1990) 2020-06-23 11:47:17 +01:00
field_element.go Feature/key compression (#1990) 2020-06-23 11:47:17 +01:00
fp.go Feature/key compression (#1990) 2020-06-23 11:47:17 +01:00
fp2.go Feature/key compression (#1990) 2020-06-23 11:47:17 +01:00
fp6.go Feature/key compression (#1990) 2020-06-23 11:47:17 +01:00
fp12.go Feature/key compression (#1990) 2020-06-23 11:47:17 +01:00
g1.go Feature/key compression (#1990) 2020-06-23 11:47:17 +01:00
g2.go Feature/key compression (#1990) 2020-06-23 11:47:17 +01:00
gt.go Feature/key compression (#1990) 2020-06-23 11:47:17 +01:00
hash_to_field.go Feature/key compression (#1990) 2020-06-23 11:47:17 +01:00
isogeny.go Feature/key compression (#1990) 2020-06-23 11:47:17 +01:00
pairing.go Feature/key compression (#1990) 2020-06-23 11:47:17 +01:00
swu.go Feature/key compression (#1990) 2020-06-23 11:47:17 +01:00
utils.go Feature/key compression (#1990) 2020-06-23 11:47:17 +01:00
wnaf.go Feature/key compression (#1990) 2020-06-23 11:47:17 +01:00

README.md

High Speed BLS12-381 Implementation in Go

Pairing Instance

A Group instance or a pairing engine instance is not suitable for concurrent processing since an instance has its own preallocated memory for temporary variables. A new instance must be created for each thread.

Base Field

x86 optimized base field is generated with kilic/fp and for native go is generated with goff. Generated codes are slightly edited in both for further requirements.

Scalar Field

Standart big.Int module is currently used for scalar field implementation. x86 optimized faster field implementation is planned to be added.

Serialization

Point serialization is in line with zkcrypto library.

Hashing to Curve

Hashing to curve implementations for both G1 and G2 follows _XMD:SHA-256_SSWU_RO_ and _XMD:SHA-256_SSWU_NU_ suites as defined in v7 of irtf hash to curve draft.

Benchmarks

on 3.1 GHz i5

BenchmarkPairing  1034837 ns/op