public void TestSettingEmptySaltDoesNotThrow() =>
 Assert.DoesNotThrow(() =>
                     _ = HashFactory.XOF.CreateBlake2XS(
                         Blake2XSConfig.CreateBlake2XSConfig(new Blake2SConfig(HashSize)
 {
     Salt = EmptyBytes
 }, null), 256));
 public void TestSettingNullSaltThrowsCorrectException() =>
 Assert.Throws <ArgumentNullException>(() =>
                                       _ = HashFactory.XOF.CreateBlake2XS(
                                           Blake2XSConfig.CreateBlake2XSConfig(new Blake2SConfig(HashSize)
 {
     Salt = NullBytes
 }, 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));
Beispiel #5
0
 public static IXOF CreateBlake2XS(byte[] key, ulong xofSizeInBits) =>
 CreateBlake2XS(Blake2XSConfig.CreateBlake2XSConfig(new Blake2SConfig {
     Key = key
 }, null),
                xofSizeInBits);
Beispiel #6
0
 public static IXOF CreateBlake2XS(Blake2XSConfig config, ulong xofSizeInBits) =>
 new Blake2XS(config)
 {
     XofSizeInBits = xofSizeInBits
 };