private static Func <HashAlgorithm> GetHashAlgorithm(BlakeTypes type) { return(type switch { //BlakeTypes.Blake256 => () => new Blake256(), BlakeTypes.Blake512 => () => new Blake512() });
public static IBlake Create(BlakeTypes type, BlakeConfig config) { return(type switch { //BlakeTypes.Blake256 => new Blake1Function(config, BlakeTypes.Blake256), BlakeTypes.Blake512 => new Blake1Function(config, BlakeTypes.Blake512), BlakeTypes.Blake2S => new Blake2SFunction(config), BlakeTypes.Blake2B => new Blake2BFunction(config), _ => new Blake2BFunction(config) });
public static BlakeConfig Map(BlakeTypes type) { return(type switch { //BlakeTypes.Blake256 => new BlakeConfig {HashSizeInBits = 256}, BlakeTypes.Blake512 => new BlakeConfig { HashSizeInBits = 512 }, BlakeTypes.Blake2S => new BlakeConfig { HashSizeInBits = 256 }, BlakeTypes.Blake2B => new BlakeConfig { HashSizeInBits = 512 }, });
public static IBlake Create(BlakeTypes type = BlakeTypes.Blake2B) { return(Create(type, BlakeTable.Map(type))); }
public static IBlake Create(BlakeTypes type, BlakeConfig config) => Factory.Create(type, config);
public static IBlake Create(BlakeTypes type = BlakeTypes.Blake2B) => Factory.Create(type);
public BlockTransformer(BlakeConfig config, BlakeTypes type) { _type = type; _hashSizeInBits = config.HashSizeInBits; _internalAlgorithmFactory = GetHashAlgorithm(_type); }
public Blake1Function(BlakeConfig config, BlakeTypes type) { HashType = type; _config = config; }