diff options
Diffstat (limited to 'recipes-kernel/cryptodev/sdk_patches/0046-add-support-for-sha1-hash-async-speed-test.patch')
| -rw-r--r-- | recipes-kernel/cryptodev/sdk_patches/0046-add-support-for-sha1-hash-async-speed-test.patch | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/recipes-kernel/cryptodev/sdk_patches/0046-add-support-for-sha1-hash-async-speed-test.patch b/recipes-kernel/cryptodev/sdk_patches/0046-add-support-for-sha1-hash-async-speed-test.patch new file mode 100644 index 000000000..fb902fbd7 --- /dev/null +++ b/recipes-kernel/cryptodev/sdk_patches/0046-add-support-for-sha1-hash-async-speed-test.patch | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | From c2fed59ef63a1b9da26e8a5452004b07aad39261 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alexe Radu <radu.alexe@nxp.com> | ||
| 3 | Date: Tue, 25 Oct 2016 11:21:47 +0300 | ||
| 4 | Subject: [PATCH 046/104] add support for sha1 hash async speed test | ||
| 5 | |||
| 6 | Signed-off-by: Alexe Radu <radu.alexe@nxp.com> | ||
| 7 | --- | ||
| 8 | tests/async_speed.c | 23 +++++++++++++++++++++++ | ||
| 9 | 1 file changed, 23 insertions(+) | ||
| 10 | |||
| 11 | diff --git a/tests/async_speed.c b/tests/async_speed.c | ||
| 12 | index 8978b4b..64d5603 100644 | ||
| 13 | --- a/tests/async_speed.c | ||
| 14 | +++ b/tests/async_speed.c | ||
| 15 | @@ -260,6 +260,29 @@ int main(void) | ||
| 16 | break; | ||
| 17 | } | ||
| 18 | |||
| 19 | + fprintf(stderr, "\nTesting SHA-1 hash: \n"); | ||
| 20 | + memset(&sess, 0, sizeof(sess)); | ||
| 21 | + sess.mac = CRYPTO_SHA1; | ||
| 22 | + if (ioctl(fdc, CIOCGSESSION, &sess)) { | ||
| 23 | + perror("ioctl(CIOCGSESSION)"); | ||
| 24 | + return 1; | ||
| 25 | + } | ||
| 26 | +#ifdef CIOCGSESSINFO | ||
| 27 | + siop.ses = sess.ses; | ||
| 28 | + if (ioctl(fdc, CIOCGSESSINFO, &siop)) { | ||
| 29 | + perror("ioctl(CIOCGSESSION)"); | ||
| 30 | + return 1; | ||
| 31 | + } | ||
| 32 | + printf("requested hash CRYPTO_SHA1, got %s with driver %s\n", | ||
| 33 | + siop.hash_info.cra_name, siop.hash_info.cra_driver_name); | ||
| 34 | + alignmask = siop.alignmask; | ||
| 35 | +#endif | ||
| 36 | + | ||
| 37 | + for (i = 256; i <= (64 * 1024); i *= 2) { | ||
| 38 | + if (encrypt_data(&sess, fdc, i, alignmask)) | ||
| 39 | + break; | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | end: | ||
| 43 | close(fdc); | ||
| 44 | close(fd); | ||
| 45 | -- | ||
| 46 | 2.10.2 | ||
| 47 | |||
