aboutsummaryrefslogtreecommitdiff
path: root/src/core/crypto/aes_util.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [common] rework BitField and BitUtil, use concepts whenever possible (#4076)lizzie2026-07-091-17/+12
| | | | | | | | | | test no regressions especially on Liiinux Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4076 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
* [common/logging] Simplify logging logic and fix issues when logging before ↵lizzie2026-03-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | system is created (#3688) - our logging code was bigger than spdlog itself, why???? just keep it simple - fix issues when logging before logging system is even started - removes the "initialized logging twice" issue - removes uneeded indirection in file logging - uses direct formatting instead of jumping hoopla-around the fmt::format() ressult - code duplication and dead code removal as usual I did explore dup2() but I think it's not worth the hassle I did try `fwopen()` but it's better if things are just kept as-is. there is a lot of noise because I removed a bunch of redundant files on logging and just put everything in one file now normally this wouldn't be a good idea, however consider: the complexity of logging; it's less than 500 lines... does it really need a whole subsystem?!?!?! ITS JUST LOGGING Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3688 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: DraVee <chimera@dravee.dev> Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [ports] Remove ENABLE_OPENSSL and mbedtls nixos remnants (#3638)lizzie2026-03-011-11/+4
| | | | | | | | | | | | shell.nix still had references to mbedtls Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3638 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: DraVee <dravee@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [crypto] Atomize all traces of MbedTLS, and require OpenSSL 3+ (#3606)lizzie2026-02-231-62/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes #3137 Closes #3465 - Replace all mbedtls usage with OpenSSL - require OpenSSL - Up OpenSSL version to 3, cuz that's what we actually need... CAVEATS: - httplib also now required - other ssl backends for svc are unused, maybe remove later * To be fair, our CI never used them anyways. And we never tested those TESTERS PLEASE TEST: - All games and applets boot - Boot, load, exit, etc. times Co-authored-by: crueter <crueter@eden-emu.dev> Signed-off-by: lizzie <lizzie@eden-emu.dev> Co-authored-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3606 Reviewed-by: crueter <crueter@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: DraVee <dravee@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* [crypto] Rework AES CTR/XTS streaming and squash heap churn (#2782)godpow2025-10-261-25/+39
| | | | | | | | | | | | | | | | AES Updates: Replaced heap churn with stack scratch buffers tail handling now stays in-place, no more recursive transcode detours. CTR/XTS modes read in larger, aligned chunks and still handle odd offsets cleanly. XTS prefetches a few sectors ahead to reduce extra reads. AesCtrStorage writer now uses the pooled buffer properly one stack slab, chunk forward, bump counter, repeat. Result: less malloc noise, fewer watchdog spikes at startup (though mbedtls still sets the pace). This should make the loading speed slightly better than before. Make sure to test. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2782 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: godpow <thesaviorsrule@yahoo.com> Co-committed-by: godpow <thesaviorsrule@yahoo.com>
* [nca] Use better tight loop allocation schemes (none at all) for AES ↵lizzie2025-10-171-27/+31
| | | | | | | | | | | | | | | | decrypt/encrypt and force MbedTLS to use AES x86_64 instructions (#2750) Uses stack instead of allocating stuff haphazardly (16 bytes and 512 bytes respectively) - removes malloc() pollution and all that nasty stuff from tight loops Original work by Ribbit but edited by me. Will NOT bring a massive speedup since the main bottleneck is mbedtls itself, but may bring nice oddities to STARTUP TIMES nonetheless. AES instructions being forced wont affect CPUs without them since there is always a runtime check for them. Signed-off-by: lizzie lizzie@eden-emu.dev Co-authored-by: Ribbit <ribbit@placeholder.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2750 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
* general: Convert source file copyright comments over to SPDXMorph2022-04-231-3/+2
| | | | | This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
* aes_util: Make use of std::spanLioncash2021-04-231-3/+3
| | | | | Allows us to simplify the interface quite a bit as it will handle contiguous sequences for us.
* aes_util: Remove malformed mbedtls_cipher_finish function callMorph2021-03-051-2/+0
|
* aes_util: Make use of non-template variant of TranscodeLioncash2020-08-061-1/+1
| | | | Same behavior, less template instantiations.
* aes_util: Allow SetIV to be non-allocatingLioncash2020-08-031-9/+12
| | | | | | In a few places, the data to be set as the IV is already within an array. We shouldn't require this data to be heap-allocated if it doesn't need to be. This allows certain callers to reduce heap churn.
* Port #4182 from Citra: "Prefix all size_t with std::"fearlessTobi2018-09-151-17/+20
|
* aes_util: Fix error involving reads of less than 0x10Zach Hilman2018-09-041-0/+14
| | | | Issues with block size are fixed by making all reads minimum length of 0x10
* aes_util: Make XTSTranscode stricter about sizesZach Hilman2018-08-231-5/+2
| | | | XTS with Nintendo Tweak will fail mysteriously if the sector size is not 0x4000. Upgrade the critical log to an assert to prevent undefined behavior.
* aes_util: Make CalculateNintendoTweak() an internally linked functionLioncash2018-08-041-10/+10
| | | | | This function doesn't directly depend on class state, so it can be hidden entirely from the interface in the cpp file.
* aes_util: Make Transcode() a const member functionLioncash2018-08-041-6/+7
| | | | This doesn't modify member state, so it can be made const.
* core/crypto: Remove unnecessary includesLioncash2018-08-041-0/+2
|
* Make XCI comply to review and style guidelinesZach Hilman2018-08-011-37/+45
|
* Extract mbedtls to cpp fileZach Hilman2018-08-011-2/+100
|
* Remove files that are not usedZach Hilman2018-08-011-0/+6