You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.1 KiB

  1. // System.Security.Cryptography.Aes
  2. #if NET20
  3. using System;
  4. using System.Runtime.CompilerServices;
  5. using System.Security.Cryptography;
  6. namespace System.Security.Cryptography
  7. {
  8. internal abstract class Aes : SymmetricAlgorithm
  9. {
  10. private static KeySizes[] s_legalBlockSizes = new KeySizes[1] { new KeySizes(128, 128, 0) };
  11. private static KeySizes[] s_legalKeySizes = new KeySizes[1] { new KeySizes(128, 256, 64) };
  12. protected Aes()
  13. {
  14. base.LegalBlockSizesValue = s_legalBlockSizes;
  15. base.LegalKeySizesValue = s_legalKeySizes;
  16. base.BlockSizeValue = 128;
  17. base.FeedbackSizeValue = 8;
  18. base.KeySizeValue = 256;
  19. base.ModeValue = CipherMode.CBC;
  20. }
  21. public new static Aes Create()
  22. {
  23. return Create("AES");
  24. }
  25. public new static Aes Create(string algorithmName)
  26. {
  27. if (algorithmName == null)
  28. {
  29. throw new ArgumentNullException("algorithmName");
  30. }
  31. return CryptoConfig.CreateFromName(algorithmName) as Aes;
  32. }
  33. }
  34. }
  35. #endif