class Poseidon

Defined in:

poseidon.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(prime : BigInt, security, width = 0, capacity = -1) #

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


[View source]

Class Method Detail

def self.bytes_to_field(data : Array(UInt8)) #

[View source]
def self.field_to_bytes(b) #

[View source]
def self.new_horizen #

Returns a poseidon object with (current) Horizen parameters


[View source]

Instance Method Detail

def absorb(chunks, params) #

[View source]
def auto_parameters(security = 128) #

[View source]
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


[View source]
def field_size #

number of bytes that can fit in a field element


[View source]
def hash(data : Array(UInt8), hash_size, params : PoseidonParams) #

[View source]
def perm(state_words, params : PoseidonParams) #

[View source]
def preprocess(data : Array(UInt8)) #

convert input into arrays of field


[View source]
def squeeze(hash_size, params) #

size in bytes


[View source]
def to_byte(field_data : Array(BigInt)) #

Convert an array of field elements to bytes


[View source]
def to_field(data : Array(UInt8), k) #

convert k elements to field


[View source]