public void TestSettingNullSaltThrowsCorrectException() => Assert.Throws <ArgumentNullException>(() => _ = HashFactory.XOF.CreateBlake2XS( Blake2XSConfig.CreateBlake2XSConfig(new Blake2SConfig(HashSize) { Salt = NullBytes }, null), 256));
public void TestSettingEmptySaltDoesNotThrow() => Assert.DoesNotThrow(() => _ = HashFactory.XOF.CreateBlake2XS( Blake2XSConfig.CreateBlake2XSConfig(new Blake2SConfig(HashSize) { Salt = EmptyBytes }, null), 256));
public void TestSettingOutOfRangeSaltThrowsCorrectException() => Assert.Throws <ArgumentException>(() => _ = HashFactory.XOF.CreateBlake2XS( Blake2XSConfig.CreateBlake2XSConfig(new Blake2SConfig(HashSize) { Salt = new byte[9] }, null), 256));
public void TestSettingEmptyPersonalizationDoesNotThrowsException() => Assert.DoesNotThrow(() => _ = HashFactory.XOF.CreateBlake2XS( Blake2XSConfig.CreateBlake2XSConfig(new Blake2SConfig(HashSize) { Personalization = EmptyBytes }, null), 256));
public static IXOF CreateBlake2XS(byte[] key, ulong xofSizeInBits) => CreateBlake2XS(Blake2XSConfig.CreateBlake2XSConfig(new Blake2SConfig { Key = key }, null), xofSizeInBits);