|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH 2/2] crypto/rijndael: adjust for Misra C:2012 rule 8.3
On 14.05.2026 20:11, Andrew Cooper wrote:
> On 13/05/2026 3:01 pm, Jan Beulich wrote:
>> ... ("All declarations of an object or function shall use the same names
>> and type qualifiers"). Bring declarations in line with the corresponding
>> definitions, accepting the use of the being-phased-out u<N> types. While
>> we don't define NEED_RIJNDAEL_DECRYPT, cover rijndaelKeySetupDec() as
>> well for completeness.
>>
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>>
>> --- a/xen/include/crypto/rijndael.h
>> +++ b/xen/include/crypto/rijndael.h
>> @@ -50,9 +50,8 @@ int rijndael_set_key_enc_only(rijndael_c
>> void rijndael_decrypt(rijndael_ctx *ctx, const unsigned char *src,
>> unsigned char *dst);
>> void rijndael_encrypt(rijndael_ctx *ctx, const unsigned char *src,
>> unsigned char *dst);
>>
>> -int rijndaelKeySetupEnc(unsigned int rk[], const unsigned char cipherKey[],
>> int keyBits);
>> -int rijndaelKeySetupDec(unsigned int rk[], const unsigned char cipkerKey[],
>> int keyBits);
>> -void rijndaelEncrypt(const unsigned int rk[], int Nr, const unsigned
>> char pt[16],
>> - unsigned char ct[16]);
>> +int rijndaelKeySetupEnc(u32 rk[], const u8 cipherKey[], int keyBits);
>> +int rijndaelKeySetupDec(u32 rk[], const u8 cipkerKey[], int keyBits);
>> +void rijndaelEncrypt(const u32 rk[], int Nr, const u8 pt[16], u8
>> ct[16]);
>>
>> #endif /* __RIJNDAEL_H */
>>
>
> Hmm.
>
> The rijndael_encrypt() in context is a trivial wrapper of
> rijndaelEncrypt() using rijndael_ctx. The only user is VMAC which
> defines aes_encryption() in terms of rijndaelEncrypt(), making
> rijndael_encrypt() dead code. The decrypt side is even deader code.
>
> It might be worth taking this patch in the short term, but I think we
> could get away with a lot of deletion.
Well, really this whole piece of code would likely better be replaced by
something structured, assuming it's going to be needed at all anymore
after TBOOT deletion.
Jan
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |