-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# AES-CBC-MetaTrader | ||
AES 256 bit algorithm in CBC mode for MetaTrader | ||
|
||
This is an implementation of the AES algorithm, specifically CBC mode. | ||
|
||
Based on the code https://github.com/kokke/tiny-AES-c. There you can see the code's comments that have been removed here. | ||
|
||
## Usage | ||
```C | ||
// Initialize context calling one of: | ||
void AES_init_ctx(AES_ctx& ctx, const uchar &key[]); | ||
void AES_init_ctx_iv(AES_ctx &ctx, const uchar &key[], const uchar &iv[]); | ||
|
||
// Set IV | ||
void AES_ctx_set_iv(AES_ctx &ctx, const uchar &iv[]); | ||
|
||
// Then start encrypting and decrypting with the functions below: | ||
void AES_CBC_encrypt_buffer(AES_ctx &ctx, uchar &buf[], uchar &out[]); | ||
void AES_CBC_decrypt_buffer(AES_ctx &ctx, uchar &buf[], uchar &out[]); | ||
|
||
// Padding the buffer | ||
void fillPadding_PKCS7(uchar &buf[]); | ||
|
||
// Checks if padding is filled in correctly | ||
bool checkPadding_PKCS7(const uchar &buf[]); | ||
|
||
// Removes padding | ||
void unFillPadding_PKCS7(uchar &buf[]); | ||
``` |