예제 #1
0
 public static void SetBlockSize_Uses_LegalBlockSizesProperty()
 {
     using (SymmetricAlgorithm s = new DoesNotSetKeySizesFields())
     {
         Assert.Throws <CryptographicException>(() => s.BlockSize = 0);
         s.BlockSize = 8;
     }
 }
예제 #2
0
 public static void SetKey_Uses_LegalKeySizesProperty()
 {
     using (SymmetricAlgorithm s = new DoesNotSetKeySizesFields())
     {
         Assert.Throws <CryptographicException>(() => s.Key = Array.Empty <byte>());
         s.Key = new byte[16];
     }
 }
예제 #3
0
 public static void SetBlockSize_Uses_LegalBlockSizesProperty()
 {
     using (SymmetricAlgorithm s = new DoesNotSetKeySizesFields())
     {
         Assert.Throws<CryptographicException>(() => s.BlockSize = 0);
         s.BlockSize = 8;
     }
 }
예제 #4
0
 public static void SetKey_Uses_LegalKeySizesProperty()
 {
     using (SymmetricAlgorithm s = new DoesNotSetKeySizesFields())
     {
         Assert.Throws<CryptographicException>(() => s.Key = Array.Empty<byte>());
         s.Key = new byte[16];
     }
 }