mirror of
https://github.com/logos-storage/nim-goldilocks-hash.git
synced 2026-01-04 06:33:13 +00:00
13 lines
361 B
Nim
13 lines
361 B
Nim
|
|
import ../types
|
|
|
|
proc c_compress(a, b: var Digest, key: uint64, output: var Digest) {. header: "goldilocks.h", importc: "goldilocks_monolith_keyed_compress", cdecl .}
|
|
|
|
# keyed compression function
|
|
func compress*(a, b: Digest, key: uint64 = 0) : Digest =
|
|
var x: Digest = a
|
|
var y: Digest = b
|
|
var output: Digest
|
|
c_compress(x,y,key,output)
|
|
return output
|