mirror of
https://github.com/logos-storage/nim-poseidon2.git
synced 2026-05-20 00:39:28 +00:00
11 lines
231 B
Nim
11 lines
231 B
Nim
import ./types
|
|
import ./permutation
|
|
|
|
# 2-to-1 compression
|
|
func compression*(a, b : F, key = zero, which: static Flavour = HorizenLabsOld) : F =
|
|
var x = a
|
|
var y = b
|
|
var z = key
|
|
permInPlace(x, y, z, which = which)
|
|
return x
|