Last active
July 10, 2019 14:24
-
-
Save vrde/16152b28861dedaf84a9ce7af5fe7b8a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "hashes/sha256/256bitPadded.code" as sha256 | |
import "utils/pack/unpack128.code" as unpack128 | |
import "utils/pack/pack128.code" as pack128 | |
def main(private field a, private field b) -> (field[2]): | |
field[128] a128 = unpack128(a) | |
field[128] b128 = unpack128(b) | |
h = sha256([...a128, ...b128]) | |
return [pack128(h[0..128]), pack128(h[128..256])] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment