1.1.4 • Published 4 years ago

bls-oly-wasm v1.1.4

Weekly downloads
4
License
BSD-3-Clause
Repository
github
Last release
4 years ago

Node.js CI

BLS signature for Node.js by WebAssembly

Abstract

This module is built with BLS_ETH=1 for Ethereum 2.0 spec.

News

Init as the followings:

bls.init(bls.BLS12_381)
bls.setETHmode(2)

(old) The new eth2.0 functions are supported. This mode will be removed in the future.

Init as the followings:

bls.init(bls.BLS12_381)
bls.setETHmode(1)

then, you can use the following functions.

bls-eth-wasmeth2.0 spec name
SecretKey::signSign
PublicKey::verifyVerify
Sign::aggregateAggregate
Sign::fastAggregateVerifyFastAggregateVerify
Sign::aggregateVerifyNoCheckAggregateVerify

The size of message must be 32 byte.

Check functions:

  • verifySignatureOrder ; make deserialize check the correctness of the order
  • Sign::isValidOrder ; check the correctness of the order
  • verifyPublicKeyOrder ; make deserialize check the correctness of the order
  • PublicKey::isValidOrder ; check the correctness of the order
  • areAllMsgDifferent ; check that all messages are different each other

Old eth2.0 spec

The msg in the following means 40 bytes Uint8Array data.

  • SecretKey.signHashWithDomain(msg)
    • sign msg by secretKey
  • PublicKey.verifyHashWithDomain(sig, msg)
    • verify sig with msg by publickey
  • Signature.verifyAggregatedHashWithDomain(pubVec, msgVec)
    • pubVeci = secVeci.getPublicKey()
    • sigVeci = secVeci.signHashWithDomain(msgVeci)
    • aggSig = sum of sigVeci
    • aggSig.verifyAggregatedHashWithDomain(pubVec, msgVec)
    • see aggTest() in test.js

see bls

For Node.js

node test.js

License

modified new BSD License http://opensource.org/licenses/BSD-3-Clause

Author

MITSUNARI Shigeo(herumi@nifty.com) Julian Meyer julianmeyer2000@gmail.com

Sponsors welcome

GitHub Sponsor

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago