updated tlibc
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#include <assert.h>
|
||||
#include "tlibc/time.h"
|
||||
|
||||
void EncryptorAES_create(EncryptorAES* ptr, Array key){
|
||||
void EncryptorAES_create(EncryptorAES* ptr, Array(u8) key){
|
||||
assert(key.size == 16 || key.size == 24 || key.size == 32);
|
||||
|
||||
br_aes_ct64_cbcenc_init(&ptr->enc_ctx, key.data, key.size);
|
||||
@@ -15,7 +15,7 @@ void EncryptorAES_create(EncryptorAES* ptr, Array key){
|
||||
memset(ptr->iv, 0, sizeof(ptr->iv));
|
||||
}
|
||||
|
||||
void EncryptorAES_encrypt(EncryptorAES* ptr, Array src, Array dst){
|
||||
void EncryptorAES_encrypt(EncryptorAES* ptr, Array(u8) src, Array(u8) dst){
|
||||
assert(dst.size >= EncryptorAES_calcDstSize(src.size));
|
||||
|
||||
// write random bytes to the beginning of the buffer
|
||||
@@ -51,7 +51,7 @@ void EncryptorAES_encrypt(EncryptorAES* ptr, Array src, Array dst){
|
||||
}
|
||||
|
||||
|
||||
void DecryptorAES_create(DecryptorAES* ptr, Array key){
|
||||
void DecryptorAES_create(DecryptorAES* ptr, Array(u8) key){
|
||||
assert(key.size == 16 || key.size == 24 || key.size == 32);
|
||||
|
||||
br_aes_ct64_cbcdec_init(&ptr->dec_ctx, key.data, key.size);
|
||||
@@ -60,7 +60,7 @@ void DecryptorAES_create(DecryptorAES* ptr, Array key){
|
||||
memset(ptr->iv, 0, sizeof(ptr->iv));
|
||||
}
|
||||
|
||||
void DecryptorAES_decrypt(DecryptorAES* ptr, Array src, Array dst, u32* decrypted_size){
|
||||
void DecryptorAES_decrypt(DecryptorAES* ptr, Array(u8) src, Array(u8) dst, u32* decrypted_size){
|
||||
assert(dst.size >= src.size);
|
||||
|
||||
// copy encrypted header from src to buffer
|
||||
|
||||
Reference in New Issue
Block a user