public void TestSettingEmptySaltDoesNotThrow() => Assert.DoesNotThrow(() => _ = HashFactory.XOF.CreateBlake2XB( Blake2XBConfig.CreateBlake2XBConfig(new Blake2BConfig(HashSize) { Salt = EmptyBytes }, null), 512));
public void TestSettingNullSaltThrowsCorrectException() => Assert.Throws <ArgumentNullException>(() => _ = HashFactory.XOF.CreateBlake2XB( Blake2XBConfig.CreateBlake2XBConfig(new Blake2BConfig(HashSize) { Salt = NullBytes }, null), 512));
public void TestSettingOutOfRangeSaltThrowsCorrectException() => Assert.Throws <ArgumentException>(() => _ = HashFactory.XOF.CreateBlake2XB( Blake2XBConfig.CreateBlake2XBConfig(new Blake2BConfig(HashSize) { Salt = new byte[17] }, null), 512));
public void TestSettingEmptyPersonalizationDoesNotThrowsException() => Assert.DoesNotThrow(() => _ = HashFactory.XOF.CreateBlake2XB( Blake2XBConfig.CreateBlake2XBConfig(new Blake2BConfig(HashSize) { Personalization = EmptyBytes }, null), 512));
public static IXOF CreateBlake2XB(byte[] key, ulong xofSizeInBits) => CreateBlake2XB(Blake2XBConfig.CreateBlake2XBConfig(new Blake2BConfig { Key = key }, null), xofSizeInBits);
public static IXOF CreateBlake2XB(Blake2XBConfig config, ulong xofSizeInBits) => new Blake2XB(config) { XofSizeInBits = xofSizeInBits };