add blowfish
This commit is contained in:
@@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user