add blowfish

This commit is contained in:
clowwindy
2014-11-06 01:31:48 +08:00
parent 5f56ee2d2c
commit 56365fdf96
4 changed files with 57 additions and 8 deletions
+17
View File
@@ -40,5 +40,22 @@ namespace shadowsocks_csharp.Encrypt
[DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
public extern static int arc4_crypt(byte[] ctx, int length, byte[] input, byte[] output);
public const int BLOWFISH_CTX_SIZE = 4168;
public const int BLOWFISH_ENCRYPT = 1;
public const int BLOWFISH_DECRYPT = 0;
[DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
public extern static void blowfish_init(byte[] ctx);
[DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
public extern static void blowfish_free(byte[] ctx);
[DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
public extern static int blowfish_setkey(byte[] ctx, byte[] key, int keysize);
[DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
public extern static int blowfish_crypt_cfb64(byte[] ctx, int mode, int length, ref int iv_off, byte[] iv, byte[] input, byte[] output);
}
}