[riot-notifications] [RIOT-OS/RIOT] crypto/ciphers: remove unneeded max_key_size in cipher_interface_st (#16253)

Leandro Lanzieri notifications at github.com
Thu Apr 1 09:58:00 CEST 2021


@leandrolanzieri commented on this pull request.

I agree that the check of the `key_size` in `cipher_init` is limited and should be done properly in the cipher-specific `init` function. In fact, the only implementer of the interface has to do a second check of the `key_size` already.

LGTM, just a small potential improvement.

> @@ -76,9 +76,6 @@ typedef struct cipher_interface_st {
     /** Blocksize of this cipher */
     uint8_t block_size;
 
-    /** Maximum key size for this cipher */
-    uint8_t max_key_size;
-
     /** the init function */

It would be good to extend the documentation of the `init` function, explaining that it's its responsibility to check that the `key_size` is valid for the chosen cipher.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16253#pullrequestreview-625992223
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210401/1648c4a1/attachment.htm>


More information about the notifications mailing list