class Poseidon
- Poseidon
- Reference
- Object
Defined in:
poseidon.crConstructors
-
.new(prime : BigInt, security, width = 0, capacity = -1)
field prime number, desired security bits, t (permutation width)
Class Method Summary
- .bytes_to_field(data : Array(UInt8))
- .field_to_bytes(b)
-
.new_horizen
Returns a poseidon object with (current) Horizen parameters
Instance Method Summary
- #absorb(chunks, params)
- #auto_parameters(security = 128)
-
#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
-
#field_size
number of bytes that can fit in a field element
- #hash(data : Array(UInt8), hash_size, params : PoseidonParams)
- #perm(state_words, params : PoseidonParams)
-
#preprocess(data : Array(UInt8))
convert input into arrays of field
-
#squeeze(hash_size, params)
size in bytes
-
#to_byte(field_data : Array(BigInt))
Convert an array of field elements to bytes
-
#to_field(data : Array(UInt8), k)
convert k elements to field
Constructor Detail
field prime number, desired security bits, t (permutation width)
Class Method Detail
Instance Method Detail
def 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