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

CryptoParameter.cs 594 B

123456789101112131415161718192021
  1. using System;
  2. namespace Shadowsocks.Protocol.Shadowsocks.Crypto
  3. {
  4. public struct CryptoParameter
  5. {
  6. public Type Crypto;
  7. public int KeySize; // key size = salt size
  8. public int NonceSize; // reused as iv size
  9. public int TagSize;
  10. public ICrypto GetCrypto()
  11. {
  12. var ctor = Crypto.GetConstructor(new[] { typeof(CryptoParameter) }) ??
  13. throw new TypeLoadException("can't load constructor");
  14. return (ICrypto)ctor.Invoke(new object[] { this });
  15. }
  16. public bool IsAead => TagSize > 0;
  17. }
  18. }