MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / encrypt

Function encrypt

TactilityCore/Source/crypt/Crypt.cpp:165–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165int encrypt(const uint8_t iv[16], const uint8_t* inData, uint8_t* outData, size_t dataLength) {
166 check(dataLength % 16 == 0, "Length is not a multiple of 16 bytes (for AES 256)");
167 uint8_t key[32];
168 getKey(key);
169
170 // TODO: Is this still needed after switching to regular AES functions?
171 uint8_t iv_copy[16];
172 memcpy(iv_copy, iv, sizeof(iv_copy));
173
174 return aes256CryptCbc(key, MBEDTLS_AES_ENCRYPT, dataLength, iv_copy, inData, outData);
175}
176
177int decrypt(const uint8_t iv[16], const uint8_t* inData, uint8_t* outData, size_t dataLength) {
178 check(dataLength % 16 == 0, "Length is not a multiple of 16 bytes (for AES 256)");

Callers

nothing calls this directly

Calls 3

getKeyFunction · 0.85
aes256CryptCbcFunction · 0.85
checkFunction · 0.50

Tested by

no test coverage detected