-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcrypto.h
More file actions
31 lines (23 loc) · 820 Bytes
/
crypto.h
File metadata and controls
31 lines (23 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef _CRYPTO_H_
#define _CRYPTO_H_
#include <openssl/conf.h>
#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/md5.h>
#include <string.h>
struct encryptor {
void *encryptCtx;
void *decryptCtx;
int sentIv;
int receivedIv;
};
int freeCipher(struct encryptor *);
int encrypt(struct encryptor *, unsigned char *, int *, unsigned char *, int,
unsigned char *, unsigned char *);
int decrypt(struct encryptor *, unsigned char *, int *, unsigned char *, int,
unsigned char *, unsigned char *);
int encryptOnce(struct encryptor *, unsigned char *, int *, unsigned char *,
int, unsigned char *, unsigned char *);
int decryptOnce(struct encryptor *, unsigned char *, int *, unsigned char *,
int, unsigned char *, unsigned char *);
#endif