Skip to content

Commit

Permalink
crypto: tcrypt - fix skcipher multi-buffer tests for 1420B blocks
Browse files Browse the repository at this point in the history
Commit ad6d66b ("crypto: tcrypt - include 1420 byte blocks in aead and skcipher benchmarks")
mentions:
> power-of-2 block size. So let's add 1420 bytes explicitly, and round
> it up to the next blocksize multiple of the algo in question if it
> does not support 1420 byte blocks.
but misses updating skcipher multi-buffer tests.

Fix this by using the proper (rounded) input size.

Fixes: ad6d66b ("crypto: tcrypt - include 1420 byte blocks in aead and skcipher benchmarks")
Signed-off-by: Horia Geantă <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
horiag authored and herbertx committed Oct 22, 2021
1 parent 7e75c33 commit 3ae88f6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions crypto/tcrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1333,7 +1333,7 @@ static void test_mb_skcipher_speed(const char *algo, int enc, int secs,

if (bs > XBUFSIZE * PAGE_SIZE) {
pr_err("template (%u) too big for buffer (%lu)\n",
*b_size, XBUFSIZE * PAGE_SIZE);
bs, XBUFSIZE * PAGE_SIZE);
goto out;
}

Expand Down Expand Up @@ -1386,8 +1386,7 @@ static void test_mb_skcipher_speed(const char *algo, int enc, int secs,
memset(cur->xbuf[p], 0xff, k);

skcipher_request_set_crypt(cur->req, cur->sg,
cur->sg, *b_size,
iv);
cur->sg, bs, iv);
}

if (secs) {
Expand Down

0 comments on commit 3ae88f6

Please sign in to comment.