|
|
@@ -0,0 +1,51 @@ |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.Text; |
|
|
|
using System.Threading.Tasks; |
|
|
|
|
|
|
|
namespace Shadowsocks.Encryption.AEAD |
|
|
|
{ |
|
|
|
public class AEADNativeEncryptor : AEADEncryptor |
|
|
|
{ |
|
|
|
public AEADNativeEncryptor(string method, string password) |
|
|
|
: base(method, password) |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
public override void cipherDecrypt(byte[] ciphertext, uint clen, byte[] plaintext, ref uint plen) |
|
|
|
{ |
|
|
|
Array.Copy(ciphertext, plaintext, 0); |
|
|
|
plen = clen; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public override void cipherEncrypt(byte[] plaintext, uint plen, byte[] ciphertext, ref uint clen) |
|
|
|
{ |
|
|
|
Array.Copy(plaintext, ciphertext, 0); |
|
|
|
clen = plen; |
|
|
|
} |
|
|
|
|
|
|
|
public override void Dispose() |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
private static Dictionary<string, EncryptorInfo> _ciphers = new Dictionary<string, EncryptorInfo>() |
|
|
|
{ |
|
|
|
{"plain-aeadfmt",new EncryptorInfo("PLAIN",0,0,0,0,0) } |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
protected override Dictionary<string, EncryptorInfo> getCiphers() |
|
|
|
{ |
|
|
|
return _ciphers; |
|
|
|
} |
|
|
|
|
|
|
|
public static IEnumerable<string> SupportedCiphers() |
|
|
|
{ |
|
|
|
return _ciphers.Keys; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |