17 #ifndef _TS2_CRYPTO_H_ 18 #define _TS2_CRYPTO_H_ 28 #define TS2_AES_BLOCK_SIZE 16 29 #define TS2_AES_KEY_LENGTH 16 30 #define TS2_AES_CBC_IV_SIZE 16 31 #define TS2_SHA1_DIGEST_SIZE 20 32 #define TS2_SHA1_BLOCK_SIZE 64 66 const ATX_Byte* input,
103 const ATX_Byte* data,
131 const ATX_Byte* data,
150 const ATX_Byte* data,
169 const ATX_Byte* data,
182 const ATX_Byte* enc_data,
192 const ATX_Byte* enc_data,
ATX_Result TS2_AesCbcEncrypt(const ATX_Byte *key, const ATX_Byte *iv, const ATX_Byte *data, ATX_Size data_size, ATX_Byte *enc_data)
helper
void TS2_AesCbcDecrypter_Destroy(TS2_AesCbcDecrypter *self)
void TS2_AesCbcEncrypter_Destroy(TS2_AesCbcEncrypter *self)
ATX_Result TS2_Hmac_Final(TS2_Hmac *self, ATX_Byte *mac)
ATX_Result TS2_ComputeHmac(TS2_DigestAlgorithm algorithm, const ATX_Byte *key, ATX_Size key_size, const ATX_Byte *data, ATX_Size data_size, ATX_Byte *mac)
helper
void TS2_Hmac_Destroy(TS2_Hmac *self)
ATX_Result TS2_AesCbcEncrypter_Encrypt(TS2_AesCbcEncrypter *self, const ATX_Byte *data, ATX_Size data_size, ATX_Byte *enc_data)
ATX_Result TS2_GeneratePseudoRandom(ATX_Byte *buffer, ATX_Size size)
ATX_Result TS2_ComputeDigest(TS2_DigestAlgorithm algorithm, const ATX_Byte *data, ATX_Size data_size, ATX_Byte *digest)
helper
ATX_Size TS2_Digest_GetDigestSize(const TS2_Digest *self)
Definition: Ts2Crypto.h:49
void TS2_AesBlockCipher_Destroy(TS2_AesBlockCipher *self)
ATX_Result TS2_Digest_Update(TS2_Digest *self, const ATX_Byte *data, ATX_Size data_size)
ATX_Result TS2_Hmac_Create(TS2_DigestAlgorithm algorithm, const ATX_Byte *key, ATX_Size key_size, TS2_Hmac **hmac)
Definition: Ts2Crypto.h:45
ATX_Result TS2_Digest_Final(TS2_Digest *self, ATX_Byte *digest)
ATX_Result TS2_Digest_Create(TS2_DigestAlgorithm algorithm, TS2_Digest **digest)
ATX_Size TS2_Hmac_GetMacSize(TS2_Hmac *self)
void TS2_Digest_Destroy(TS2_Digest *self)
ATX_Result TS2_AesBlockCipher_ProcessBlock(TS2_AesBlockCipher *self, const ATX_Byte *input, ATX_Byte *output)
struct TS2_AesBlockCipher TS2_AesBlockCipher
Definition: Ts2Crypto.h:37
ATX_Size TS2_Digest_GetBlockSize(const TS2_Digest *self)
struct TS2_Hmac TS2_Hmac
Definition: Ts2Crypto.h:38
struct TS2_Digest TS2_Digest
Definition: Ts2Crypto.h:39
struct TS2_AesCbcEncrypter TS2_AesCbcEncrypter
Definition: Ts2Crypto.h:40
struct TS2_AesCbcDecrypter TS2_AesCbcDecrypter
Definition: Ts2Crypto.h:41
ATX_Result TS2_AesCbcDecrypt(const ATX_Byte *key, const ATX_Byte *iv, const ATX_Byte *enc_data, ATX_Size data_size, ATX_Byte *dec_data)
helper
ATX_Result TS2_AesCbcDecrypter_Decrypt(TS2_AesCbcDecrypter *self, const ATX_Byte *enc_data, ATX_Size data_size, ATX_Byte *dec_data)
Definition: Ts2Crypto.h:44
ATX_Result TS2_AesCbcDecrypter_Create(const ATX_Byte *key, const ATX_Byte *iv, TS2_AesCbcDecrypter **decrypter)
TS2_DigestAlgorithm
Definition: Ts2Crypto.h:48
ATX_Result TS2_AesBlockCipher_Create(const ATX_Byte *key, TS2_BlockCipherDirection direction, TS2_AesBlockCipher **cipher)
ATX_Result TS2_AesCbcEncrypter_Create(const ATX_Byte *key, const ATX_Byte *iv, TS2_AesCbcEncrypter **encrypter)
ATX_Result TS2_Hmac_Update(TS2_Hmac *self, const ATX_Byte *data, ATX_Size data_size)
TS2_BlockCipherDirection
Definition: Ts2Crypto.h:43