Re: [PATCH 13/15] crypto: cts,xts - Update parameters blocksize/chunksize/tailsize

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

 



On Wed, Feb 14, 2024 at 03:00:21PM -0800, Eric Biggers wrote:
>
> Before messing around with cra_blocksize, it needs to be decided what it
> actually means, and document it appropriately.  According to the current
> specification, AES_BLOCK_SIZE is correct here, not 1:

Block size should always be set to 1 unless the algorithm is only
capable of handling input data that is a multiple of block size.

>  * @cra_blocksize: Minimum block size of this transformation. The size in bytes
>  *		   of the smallest possible unit which can be transformed with
>  *		   this algorithm. The users must respect this value.
>  *		   In case of HASH transformation, it is possible for a smaller
>  *		   block than @cra_blocksize to be passed to the crypto API for
>  *		   transformation, in case of any other transformation type, an
>  * 		   error will be returned upon any attempt to transform smaller
>  *		   than @cra_blocksize chunks.

OK this is wrong.  We should fix it.  For skciphers, the input
length must be a multiple of blocksize.

We should probably replace this comment with one that refers to
each algorithm type and then document the meaning there.

Thanks,
-- 
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt




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