mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-05-29 12:18:51 +00:00
aes: Fix sequence point warning
This commit is contained in:
parent
ea30ebe393
commit
f9ab9f828b
@ -7,10 +7,6 @@ add_library(TrezorCrypto STATIC ${SOURCES})
|
|||||||
target_include_directories(TrezorCrypto PUBLIC .)
|
target_include_directories(TrezorCrypto PUBLIC .)
|
||||||
target_include_directories(TrezorCrypto PUBLIC ed25519-donna)
|
target_include_directories(TrezorCrypto PUBLIC ed25519-donna)
|
||||||
|
|
||||||
# disable sequence point warnings where they are expected
|
|
||||||
set_source_files_properties(aeskey.c PROPERTIES
|
|
||||||
COMPILE_FLAGS -Wno-sequence-point)
|
|
||||||
|
|
||||||
target_compile_options(TrezorCrypto PRIVATE "-std=c99")
|
target_compile_options(TrezorCrypto PRIVATE "-std=c99")
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
|
1
Makefile
1
Makefile
@ -24,7 +24,6 @@ CFLAGS += $(OPTFLAGS) \
|
|||||||
-Werror
|
-Werror
|
||||||
|
|
||||||
# disable sequence point warning because of AES code
|
# disable sequence point warning because of AES code
|
||||||
CFLAGS += -Wno-sequence-point
|
|
||||||
CFLAGS += -I.
|
CFLAGS += -I.
|
||||||
CFLAGS += -Iaes
|
CFLAGS += -Iaes
|
||||||
CFLAGS += -Ichacha20poly1305
|
CFLAGS += -Ichacha20poly1305
|
||||||
|
20
aes/aeskey.c
20
aes/aeskey.c
@ -393,8 +393,11 @@ AES_RETURN aes_xi(decrypt_key192)(const unsigned char *key, aes_decrypt_ctx cx[1
|
|||||||
cx->ks[v(48,(3))] = ss[3] = word_in(key, 3);
|
cx->ks[v(48,(3))] = ss[3] = word_in(key, 3);
|
||||||
|
|
||||||
#ifdef DEC_KS_UNROLL
|
#ifdef DEC_KS_UNROLL
|
||||||
cx->ks[v(48,(4))] = ff(ss[4] = word_in(key, 4));
|
ss[4] = word_in(key, 4);
|
||||||
cx->ks[v(48,(5))] = ff(ss[5] = word_in(key, 5));
|
ss[5] = word_in(key, 5);
|
||||||
|
|
||||||
|
cx->ks[v(48,(4))] = ff(ss[4]);
|
||||||
|
cx->ks[v(48,(5))] = ff(ss[5]);
|
||||||
kdf6(cx->ks, 0); kd6(cx->ks, 1);
|
kdf6(cx->ks, 0); kd6(cx->ks, 1);
|
||||||
kd6(cx->ks, 2); kd6(cx->ks, 3);
|
kd6(cx->ks, 2); kd6(cx->ks, 3);
|
||||||
kd6(cx->ks, 4); kd6(cx->ks, 5);
|
kd6(cx->ks, 4); kd6(cx->ks, 5);
|
||||||
@ -485,10 +488,15 @@ AES_RETURN aes_xi(decrypt_key256)(const unsigned char *key, aes_decrypt_ctx cx[1
|
|||||||
cx->ks[v(56,(3))] = ss[3] = word_in(key, 3);
|
cx->ks[v(56,(3))] = ss[3] = word_in(key, 3);
|
||||||
|
|
||||||
#ifdef DEC_KS_UNROLL
|
#ifdef DEC_KS_UNROLL
|
||||||
cx->ks[v(56,(4))] = ff(ss[4] = word_in(key, 4));
|
ss[4] = word_in(key, 4);
|
||||||
cx->ks[v(56,(5))] = ff(ss[5] = word_in(key, 5));
|
ss[5] = word_in(key, 5);
|
||||||
cx->ks[v(56,(6))] = ff(ss[6] = word_in(key, 6));
|
ss[6] = word_in(key, 6);
|
||||||
cx->ks[v(56,(7))] = ff(ss[7] = word_in(key, 7));
|
ss[7] = word_in(key, 7);
|
||||||
|
|
||||||
|
cx->ks[v(56,(4))] = ff(ss[4]);
|
||||||
|
cx->ks[v(56,(5))] = ff(ss[5]);
|
||||||
|
cx->ks[v(56,(6))] = ff(ss[6]);
|
||||||
|
cx->ks[v(56,(7))] = ff(ss[7]);
|
||||||
kdf8(cx->ks, 0); kd8(cx->ks, 1);
|
kdf8(cx->ks, 0); kd8(cx->ks, 1);
|
||||||
kd8(cx->ks, 2); kd8(cx->ks, 3);
|
kd8(cx->ks, 2); kd8(cx->ks, 3);
|
||||||
kd8(cx->ks, 4); kd8(cx->ks, 5);
|
kd8(cx->ks, 4); kd8(cx->ks, 5);
|
||||||
|
Loading…
Reference in New Issue
Block a user