Re: [PATCH v4 3/3] crypto: aesgcm - Provide minimal library implementation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 24, 2022 at 08:30:52AM +0200, Ard Biesheuvel wrote:
> The former concern is addressed trivially, given that the function call
> API uses 32-bit signed types for the input lengths. It is still up to
> the caller to avoid IV reuse in general, but this is not something we
> can police at the implementation level.

This doesn't seem to have been any note left about this in the code itself.
Sizes are usually size_t, so if another type is used intentionally, that should
be carefully documented.

Also, does it really need to be signed?

> +int __must_check aesgcm_decrypt(const struct aesgcm_ctx *ctx, u8 *dst,
> +				const u8 *src, int crypt_len, const u8 *assoc,
> +				int assoc_len, const u8 iv[GCM_AES_IV_SIZE],
> +				const u8 *authtag);

This returns 0 or -EBADMSG, which is inconsistent with
chacha20poly1305_decrypt() which returns a bool.  It would be nice if the
different algorithms would use consistent conventions.

-  Eric



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux