forked from silicontrip/SkyReader
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathcrypt.h
28 lines (22 loc) · 841 Bytes
/
crypt.h
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
#pragma once
#include "md5.h"
#include "rijndael.h"
#include "crypt.h"
#include <memory.h>
#include <stdlib.h>
#include <assert.h>
#include <stdio.h>
class Crypt {
public:
int IsAccessControlBlock(unsigned int);
void EncryptTagBlock(unsigned char*, unsigned int , unsigned char const* );
void DecryptTagBlock(unsigned char*, unsigned int , unsigned char const* );
void EncryptBuffer(unsigned char* );
void DecryptBuffer(unsigned char* );
private:
int ShouldEncryptBlock(unsigned int );
void ComputeMD5(unsigned char [16], void const* , unsigned int );
void ComputeEncryptionKey(unsigned char [16], unsigned char const* , unsigned int );
void EncryptAES128ECB(unsigned char * , unsigned char const* , unsigned char* );
void DecryptAES128ECB(unsigned char * , unsigned char const* , unsigned char* );
};