mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-11-03 16:45:53 +00:00
WIP: almost there
This commit is contained in:
+8
-4
@@ -16,7 +16,7 @@
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
|
||||
#define BUF_SIZE 4096
|
||||
#define BUF_SIZE 512
|
||||
#define BLOCK_SIZE 32
|
||||
|
||||
#define NONE -1
|
||||
@@ -29,14 +29,18 @@
|
||||
#define CAST5_CFB 6
|
||||
#define DES_CFB 7
|
||||
|
||||
#define min(a,b) (((a)<(b))?(a):(b))
|
||||
#define max(a,b) (((a)>(b))?(a):(b))
|
||||
|
||||
struct enc_ctx {
|
||||
int method;
|
||||
uint8_t key[EVP_MAX_KEY_LENGTH];
|
||||
uint8_t iv[EVP_MAX_IV_LENGTH];
|
||||
EVP_CIPHER_CTX *evp;
|
||||
EVP_CIPHER_CTX evp;
|
||||
};
|
||||
|
||||
char* encrypt(char *plaintext, int *len, struct enc_ctx *ctx);
|
||||
char* decrypt(char *ciphertext, int *len, struct enc_ctx *ctx);
|
||||
char* encrypt(char *plaintext, ssize_t *len, struct enc_ctx *ctx);
|
||||
char* decrypt(char *ciphertext, ssize_t *len, struct enc_ctx *ctx);
|
||||
void enc_ctx_init(int method, struct enc_ctx *ctx, int enc);
|
||||
int enc_init(const char *pass, const char *method);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user