SEFile
Userspace drivers to manage a secure filesystem
 All Data Structures Files Functions Variables Typedefs Enumerator Macros Groups
se3_common.h
1 #pragma once
2 
3 #include "se3c0def.h"
4 #include "aes256.h"
5 #include "sha256.h"
6 #include "pbkdf2.h"
7 
8 extern const uint8_t se3_magic[SE3_MAGIC_SIZE];
9 
10 
11 uint16_t se3_req_len_data(uint16_t len_data_and_headers);
12 uint16_t se3_req_len_data_and_headers(uint16_t len_data);
13 uint16_t se3_resp_len_data(uint16_t len_data_and_headers);
14 uint16_t se3_resp_len_data_and_headers(uint16_t len_data);
15 uint16_t se3_nblocks(uint16_t len);
16 
17 /*
18 enum {
19  SE3_PAYL_CRYPTO = 1,
20  SE3_PAYL_SIGN = 2,
21  SE3_PAYL_CRYPTO_SIGN = 3
22 };*/
23 
24 typedef struct se3_payload_cryptoctx_ {
25  B5_tAesCtx aesenc;
26  B5_tAesCtx aesdec;
27  B5_tHmacSha256Ctx hmac;
28  uint8_t hmac_key[B5_AES_256];
29  uint8_t auth[B5_SHA256_DIGEST_SIZE];
31 void se3_payload_cryptoinit(se3_payload_cryptoctx* ctx, const uint8_t* key);
32 void se3_payload_encrypt(se3_payload_cryptoctx* ctx, uint8_t* auth, uint8_t* iv, uint8_t* data, uint16_t nblocks, uint16_t flags);
33 bool se3_payload_decrypt(se3_payload_cryptoctx* ctx, const uint8_t* auth, const uint8_t* iv, uint8_t* data, uint16_t nblocks, uint16_t flags);
#define B5_AES_256
Definition: aes256.h:42
Definition: se3_common.h:24
Definition: aes256.h:75
Definition: sha256.h:103