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.

UnsafeNoneCrypto.cs 651 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. namespace Shadowsocks.Protocol.Shadowsocks.Crypto
  3. {
  4. class UnsafeNoneCrypto : ICrypto
  5. {
  6. public UnsafeNoneCrypto(CryptoParameter parameter)
  7. {
  8. }
  9. public int Decrypt(ReadOnlySpan<byte> nonce, Span<byte> plain, ReadOnlySpan<byte> cipher)
  10. {
  11. cipher.CopyTo(plain);
  12. return plain.Length;
  13. }
  14. public int Encrypt(ReadOnlySpan<byte> nonce, ReadOnlySpan<byte> plain, Span<byte> cipher)
  15. {
  16. plain.CopyTo(cipher);
  17. return plain.Length;
  18. }
  19. public void Init(byte[] key, byte[] iv)
  20. {
  21. }
  22. }
  23. }