diff options
Diffstat (limited to 'recipes-kernel/cryptodev/sdk_patches/0048-add-support-for-aes-256-xts-sync-speed-test.patch')
| -rw-r--r-- | recipes-kernel/cryptodev/sdk_patches/0048-add-support-for-aes-256-xts-sync-speed-test.patch | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/recipes-kernel/cryptodev/sdk_patches/0048-add-support-for-aes-256-xts-sync-speed-test.patch b/recipes-kernel/cryptodev/sdk_patches/0048-add-support-for-aes-256-xts-sync-speed-test.patch new file mode 100644 index 000000000..85301aa8e --- /dev/null +++ b/recipes-kernel/cryptodev/sdk_patches/0048-add-support-for-aes-256-xts-sync-speed-test.patch | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | From 139268835b7d84472950e3ed866f41d79a0cb723 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alexe Radu <radu.alexe@nxp.com> | ||
| 3 | Date: Tue, 25 Oct 2016 12:05:13 +0300 | ||
| 4 | Subject: [PATCH 048/104] add support for aes-256-xts sync speed test | ||
| 5 | |||
| 6 | Signed-off-by: Alexe Radu <radu.alexe@nxp.com> | ||
| 7 | --- | ||
| 8 | tests/speed.c | 24 ++++++++++++++++++++++++ | ||
| 9 | 1 file changed, 24 insertions(+) | ||
| 10 | |||
| 11 | diff --git a/tests/speed.c b/tests/speed.c | ||
| 12 | index 81c5a65..16ad7b7 100644 | ||
| 13 | --- a/tests/speed.c | ||
| 14 | +++ b/tests/speed.c | ||
| 15 | @@ -206,6 +206,30 @@ int main(int argc, char** argv) | ||
| 16 | break; | ||
| 17 | } | ||
| 18 | |||
| 19 | + fprintf(stderr, "\nTesting AES-256-XTS cipher: \n"); | ||
| 20 | + memset(&sess, 0, sizeof(sess)); | ||
| 21 | + sess.cipher = CRYPTO_AES_XTS; | ||
| 22 | + sess.keylen = 32; | ||
| 23 | + memset(keybuf, 0x42, sess.keylen); | ||
| 24 | + sess.key = (unsigned char *)keybuf; | ||
| 25 | + if (ioctl(fdc, CIOCGSESSION, &sess)) { | ||
| 26 | + perror("ioctl(CIOCGSESSION)"); | ||
| 27 | + return 1; | ||
| 28 | + } | ||
| 29 | +#ifdef CIOCGSESSINFO | ||
| 30 | + siop.ses = sess.ses; | ||
| 31 | + if (ioctl(fdc, CIOCGSESSINFO, &siop)) { | ||
| 32 | + perror("ioctl(CIOCGSESSINFO)"); | ||
| 33 | + return 1; | ||
| 34 | + } | ||
| 35 | + alignmask = siop.alignmask; | ||
| 36 | +#endif | ||
| 37 | + | ||
| 38 | + for (i = 512; i <= (64 * 1024); i *= 2) { | ||
| 39 | + if (encrypt_data(&sess, fdc, i, alignmask)) | ||
| 40 | + break; | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | close(fdc); | ||
| 44 | close(fd); | ||
| 45 | return 0; | ||
| 46 | -- | ||
| 47 | 2.10.2 | ||
| 48 | |||
