diff --git a/nx/include/switch/crypto/aes.h b/nx/include/switch/crypto/aes.h index 2079e699..bd162cf8 100644 --- a/nx/include/switch/crypto/aes.h +++ b/nx/include/switch/crypto/aes.h @@ -1,6 +1,6 @@ /** * @file aes.h - * @brief Switch accelerated AES-ECB implementation. + * @brief Hardware accelerated AES-ECB implementation. * @copyright libnx Authors */ #pragma once diff --git a/nx/include/switch/crypto/aes_cbc.h b/nx/include/switch/crypto/aes_cbc.h index 2a2a7432..6f057732 100644 --- a/nx/include/switch/crypto/aes_cbc.h +++ b/nx/include/switch/crypto/aes_cbc.h @@ -1,6 +1,6 @@ /** * @file aes_cbc.h - * @brief Switch accelerated AES-CBC implementation. + * @brief Hardware accelerated AES-CBC implementation. * @copyright libnx Authors */ #pragma once diff --git a/nx/include/switch/crypto/aes_ctr.h b/nx/include/switch/crypto/aes_ctr.h index 9432140e..c31a7800 100644 --- a/nx/include/switch/crypto/aes_ctr.h +++ b/nx/include/switch/crypto/aes_ctr.h @@ -1,6 +1,6 @@ /** * @file aes_ctr.h - * @brief Switch accelerated AES-CTR implementation. + * @brief Hardware accelerated AES-CTR implementation. * @copyright libnx Authors */ #pragma once diff --git a/nx/include/switch/crypto/aes_xts.h b/nx/include/switch/crypto/aes_xts.h index 624188c6..357bd226 100644 --- a/nx/include/switch/crypto/aes_xts.h +++ b/nx/include/switch/crypto/aes_xts.h @@ -1,6 +1,6 @@ /** * @file aes_xts.h - * @brief Switch accelerated AES-XTS implementation. + * @brief Hardware accelerated AES-XTS implementation. * @copyright libnx Authors */ #pragma once @@ -36,20 +36,20 @@ typedef struct { /// 128-bit XTS API. void aes128XtsContextCreate(Aes128XtsContext *out, const void *key0, const void *key1, bool is_encryptor); void aes128XtsContextResetTweak(Aes128XtsContext *ctx, const void *tweak); -void aes128XtsContextResetSector(Aes128XtsContext *ctx, uint64_t sector, bool nintendo); +void aes128XtsContextResetSector(Aes128XtsContext *ctx, uint64_t sector, bool is_nintendo); size_t aes128XtsEncrypt(Aes128XtsContext *ctx, void *dst, const void *src, size_t size); size_t aes128XtsDecrypt(Aes128XtsContext *ctx, void *dst, const void *src, size_t size); /// 192-bit XTS API. void aes192XtsContextCreate(Aes192XtsContext *out, const void *key0, const void *key1, bool is_encryptor); void aes192XtsContextResetTweak(Aes192XtsContext *ctx, const void *tweak); -void aes192XtsContextResetSector(Aes192XtsContext *ctx, uint64_t sector, bool nintendo); +void aes192XtsContextResetSector(Aes192XtsContext *ctx, uint64_t sector, bool is_nintendo); size_t aes192XtsEncrypt(Aes192XtsContext *ctx, void *dst, const void *src, size_t size); size_t aes192XtsDecrypt(Aes192XtsContext *ctx, void *dst, const void *src, size_t size); /// 256-bit XTS API. void aes256XtsContextCreate(Aes256XtsContext *out, const void *key0, const void *key1, bool is_encryptor); void aes256XtsContextResetTweak(Aes256XtsContext *ctx, const void *tweak); -void aes256XtsContextResetSector(Aes256XtsContext *ctx, uint64_t sector, bool nintendo); +void aes256XtsContextResetSector(Aes256XtsContext *ctx, uint64_t sector, bool is_nintendo); size_t aes256XtsEncrypt(Aes256XtsContext *ctx, void *dst, const void *src, size_t size); size_t aes256XtsDecrypt(Aes256XtsContext *ctx, void *dst, const void *src, size_t size); diff --git a/nx/source/crypto/aes_xts.c b/nx/source/crypto/aes_xts.c index ceb50823..a55cf2d2 100644 --- a/nx/source/crypto/aes_xts.c +++ b/nx/source/crypto/aes_xts.c @@ -129,10 +129,10 @@ void aes128XtsContextResetTweak(Aes128XtsContext *ctx, const void *tweak) { ctx->num_buffered = 0; } -void aes128XtsContextResetSector(Aes128XtsContext *ctx, uint64_t sector, bool nintendo) { +void aes128XtsContextResetSector(Aes128XtsContext *ctx, uint64_t sector, bool is_nintendo) { /* Set and encrypt tweak, nothing is buffered. */ uint64_t *tweak_u64 = (uint64_t *)(&ctx->tweak); - if (nintendo) { + if (is_nintendo) { /* Nintendo uses big endian tweak-from-sector, despite little endian gf multiplication. */ /* This is probably a Nintendo bug, but given all their content relies on it, not like it can change... */ tweak_u64[0] = 0; @@ -472,10 +472,10 @@ void aes192XtsContextResetTweak(Aes192XtsContext *ctx, const void *tweak) { ctx->num_buffered = 0; } -void aes192XtsContextResetSector(Aes192XtsContext *ctx, uint64_t sector, bool nintendo) { +void aes192XtsContextResetSector(Aes192XtsContext *ctx, uint64_t sector, bool is_nintendo) { /* Set and encrypt tweak, nothing is buffered. */ uint64_t *tweak_u64 = (uint64_t *)(&ctx->tweak); - if (nintendo) { + if (is_nintendo) { /* Nintendo uses big endian tweak-from-sector, despite little endian gf multiplication. */ /* This is probably a Nintendo bug, but given all their content relies on it, not like it can change... */ tweak_u64[0] = 0; @@ -835,10 +835,10 @@ void aes256XtsContextResetTweak(Aes256XtsContext *ctx, const void *tweak) { ctx->num_buffered = 0; } -void aes256XtsContextResetSector(Aes256XtsContext *ctx, uint64_t sector, bool nintendo) { +void aes256XtsContextResetSector(Aes256XtsContext *ctx, uint64_t sector, bool is_nintendo) { /* Set and encrypt tweak, nothing is buffered. */ uint64_t *tweak_u64 = (uint64_t *)(&ctx->tweak); - if (nintendo) { + if (is_nintendo) { /* Nintendo uses big endian tweak-from-sector, despite little endian gf multiplication. */ /* This is probably a Nintendo bug, but given all their content relies on it, not like it can change... */ tweak_u64[0] = 0;