class

Poseidon

Inherits Reference < Object

Constructors

new(prime : BigInt, security, width = 0, capacity = -1)

field prime number, desired security bits, t (permutation width)

Source

Class methods

bytes_to_field(data : Array(UInt8))
Source
field_to_bytes(b)
Source
new_horizen

Returns a poseidon object with (current) Horizen parameters

Source

Instance methods

absorb(chunks, params)
Source
auto_parameters(security = 128)
Source
compute_capacity(security, strict = false)

compute the capacity in order to achieve the desired security WARNING - we allow for a 5% tolerance, use strict=true to ensure desired security

Source
field_size

number of bytes that can fit in a field element

Source
hash(data : Array(UInt8), hash_size, params : PoseidonParams)
Source
perm(state_words, params : PoseidonParams)
Source
preprocess(data : Array(UInt8))

convert input into arrays of field

Source
squeeze(hash_size, params)

size in bytes

Source
to_byte(field_data : Array(BigInt))

Convert an array of field elements to bytes

Source
to_field(data : Array(UInt8), k)

convert k elements to field

Source