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