Commit Graph
13 Commits
Author SHA1 Message Date
Cameron Gutman 518b244152 Rewrite MbedTLS codepaths to use the modern PSA APIs
This also fixes an issue that caused audio decryption to fail on MbedTLS 3.x.

Closes #142
2026-08-18 21:37:13 -05:00
Cameron Gutman eb21561541 Don't depend on outputDataLength to be initialized with mbedTLS
OpenSSL has no such requirement, so MbedTLS breakages snuck in.
2024-03-05 21:09:57 -06:00
Mariotaku 659202c3e5 fixed memcpy overlap (reported by AddressSanitizer) (#80)
* removed unneeded memcpy
2023-07-08 01:09:45 -05:00
Mariotaku cf0a0ced90 Use new mbedtls APIs (#75) 2023-02-13 20:31:45 -06:00
Cameron Gutman 13041e0323 Further optimization to avoid needless calls to EVP_aes_128_gcm() and EVP_aes_128_cbc() 2021-04-22 17:49:51 -05:00
Cameron Gutman 8354c403f4 Optimize OpenSSL backend to avoid redundant reinitialization
It is best to pass as few parameters to EVP_*Init_ex() as possible.
Passing a key, IV, or cipher will cause redundant work to happen behind
the scenes as OpenSSL doesn't check whether they have actually changed.

This avoids a malloc()/free() and redoing AES key expansion for every
message that is encrypted and decrypted.
2021-04-22 17:34:48 -05:00
Cameron Gutman 29d2cc6d5b Improve MbedTLS implementation of AES-CBC 2021-04-22 17:08:35 -05:00
Cameron Gutman 55cf1f8d30 Remove unnecessary calls to EVP_CIPHER_CTX_reset()
EVP_EncryptInit_ex() and EVP_DecryptInit_ex() free the cipher state as required
2021-04-22 00:17:46 -05:00
Cameron Gutman 625ec431eb Improve AES-CBC code in preparation for audio encryption 2021-04-21 23:59:14 -05:00
Cameron Gutman 873fc6f837 Build fixes 2021-04-17 22:00:53 -05:00
Cameron Gutman efaeade7a6 Small cleanup and bugfix 2021-04-17 20:24:43 -05:00
Cameron Gutman 98d7ceecf7 Add native MbedTLS crypto backend 2021-04-17 19:00:26 -05:00
Cameron Gutman d62ee951a0 Refactor OpenSSL usage into a platform-specific file to allow other crypto backends 2021-04-17 17:47:53 -05:00