mirror of
https://github.com/logos-storage/nim-goldilocks-hash.git
synced 2026-02-26 00:13:06 +00:00
12 lines
327 B
Nim
12 lines
327 B
Nim
|
|
import ./types
|
|
|
|
# the Poseidon2 permutation (mutable, in-place version)
|
|
proc permInPlace*(state: var State) {. header: "../cbits/goldilocks.h", importc: "goldilocks_poseidon2_permutation", cdecl .}
|
|
|
|
# the Poseidon2 permutation (pure version)
|
|
func perm*(state: State): State =
|
|
var tmp = state
|
|
permInPlace(tmp)
|
|
return tmp
|