mirror of
https://github.com/BeamMW/blake2-solidity.git
synced 2026-10-03 23:02:08 +00:00
This is a Solidity library aiming to implement BLAKE2 (using EIP-152).
- Solidity 61.9%
- JavaScript 38.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| contracts | ||
| migrations | ||
| test | ||
| .env.example | ||
| .gitattributes | ||
| .gitignore | ||
| .gitmodules | ||
| geth-genesis.json | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| truffle-config.js | ||
blake2-solidity
This is a Solidity library aiming to implement BLAKE2.
Currently it tries to only support BLAKE2B using the EIP-152 precompile.
Usage
It requires a recent go-ethereum develop version, since it uses the precompile.
Use the geth-genesis.json, run a local node and use truffle test.
- Download and build
go-ethereumcommitcc9eb91d30a5d4806154b832b9665aecc617b6d8 - To prepare, run
geth --datadir ./dataDir init ./geth-genesis.json - To start the node
geth --port 4321 --networkid 1234 --datadir=./dataDir --rpc --rpcport 8543 --rpcaddr 127.0.0.1 --rpcapi "eth,net,web3,personal,miner" --gasprice 0 --etherbase 0x627306090abab3a6e1400e9345bc60c78a8bef57 --mine --minerthreads=1 - Install prerequisite to truffle:
npm install --save truffle-hdwallet-provider - And finally run
truffle testto see tests succeed (or fail)
References
- Official specification: https://blake2.net/blake2.pdf
- RFC7693 (contains a shorter, but less comprehensive description): https://tools.ietf.org/html/rfc7693
- Test vectors: https://github.com/BLAKE2/BLAKE2/tree/master/testvectors
- EIP-152 (Ethereum specific application): https://eips.ethereum.org/EIPS/eip-152
Maintainer(s)
- Alex Beregszaszi @axic
License
Apache-2.0