-
-
Notifications
You must be signed in to change notification settings - Fork 814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VIP: Add support for Blake2 precompile #1651
Comments
Note: might be best to add this feature via #1230 ruleset switch so there it fails to compile under pre-Istanbul rules |
Please also include the |
blake2b_f(
rounds: uint256,
h: bytes32[2],
m: bytes32[4],
t0: Bytes[8],
t1: Bytes[8],
f: bool
) -> bytes32[2] |
We shouldn't have to make it so configurable. It should look more like:
I think it's 9 rounds for |
coming up to speed on this -- how to calculate |
The precompile at 0x09 is a large portion of what the blake2 series of hash functions use internally to compute hashes. There are several hash functions in this class, most notably Once that call is completed, the resulting hash would either be 256 bits ( Most of the time people would want to use just As a historical note, the precompile at 0x09 works with an internal method of the blake2 series of hash functions because that's what Zcash's PoW algorithm uses, and when it was created people wanted to bridge to Zcash more cheaply |
Simple Summary
Add support for
blake2
cryptographic hash functionMotivation
Blake2 is a newer but popular hash function that is being used in a variety of circumstances including ZKP due to it's efficiency under pairing operations. Support in Vyper would make it easier to develop applications that use it.
Specification
Support for Blake2 is being added in the upcoming Istanbul hardfork. The specification is in EIP-152, and a reference implementation in a client is here: https://github.com/ethereum/py-evm/blob/master/eth/precompiles/blake2.py
Function signature:
Backwards Compatibility
No backwards incompatibilities
Dependencies
No dependencies
Copyright
Copyright and related rights waived via CC0
The text was updated successfully, but these errors were encountered: