Loading…

Kryptel/Java

IHashFunctionParams interface

Declaration

package com.kryptel.hash_function;

public interface IHashFunctionParams {
  int GetHashSize() throws Exception;
  int GetPasses() throws Exception;
  byte GetScheme() throws Exception;

  int GetHashBlockSize();

  void SetHashSize(int size) throws Exception;
  void SetPasses(int passes) throws Exception;
  void SetScheme(byte scheme) throws Exception;

  HashFunctionInfo GetInfo() throws Exception;
}

Description

This interface gets or sets the hash function parameters. SetHashSize, SetPasses, and SetScheme should not be called inside an Init-Done sequence.

GetHashBlockSize

int GetHashBlockSize();

Returns the block size of the hash function. This value is needed for HMAC computing (and has no other use).

GetHashSize

int GetHashSize() throws Exception;

Returns hash size in bytes.

GetInfo

HashFunctionInfo GetInfo() throws Exception;

Returns HashFunctionInfo structure describing the hash function.

GetPasses

int GetPasses() throws Exception;

Returns the currently set number of passes.

GetScheme

byte GetScheme() throws Exception;

Returns the currently selected hash function scheme. Some hash functions exist in several variations. The scheme number designates the variation to be used.

SetHashSize

void SetHashSize(int size) throws Exception;

Set hash function's hash size in bytes. The size value must be a valid hash size from the HashFunctionInfo.ValidHashSizes list. DEFAULT_VALUE resets the hash size to the default value.

SetPasses

void SetPasses(int passes) throws Exception;

Set the number of hashing passes. The value must be one from the HashFunctionInfo.ValidPasses list, or DEFAULT_VALUE to reset the number of passes to the default value.

SetScheme

void SetScheme(byte scheme) throws Exception;

Select a hash function variation (scheme). The scheme number must be in the range from 1 to N, where N is the number of available schemes. DEFAULT_VALUE selects the hash function's default scheme.