From b673efed4a10dc31567b1c29b140b7910daeaf95 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Wed, 7 Jul 2010 19:33:33 +0200 Subject: Public and private keys are being generated in a new workqueue. Some other fixes and optimizations. --- examples/cipher.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'examples/cipher.c') diff --git a/examples/cipher.c b/examples/cipher.c index c7ce2c2..1334f02 100644 --- a/examples/cipher.c +++ b/examples/cipher.c @@ -19,10 +19,10 @@ static int test_crypto(int cfd) { - char plaintext[DATA_SIZE]; - char ciphertext[DATA_SIZE]; - char iv[BLOCK_SIZE]; - char key[KEY_SIZE]; + uint8_t plaintext[DATA_SIZE]; + uint8_t ciphertext[DATA_SIZE]; + uint8_t iv[BLOCK_SIZE]; + uint8_t key[KEY_SIZE]; struct session_op sess; struct crypt_op cryp; @@ -91,14 +91,14 @@ test_crypto(int cfd) static int test_aes(int cfd) { - char plaintext1[BLOCK_SIZE]; - char ciphertext1[BLOCK_SIZE] = { 0xdf, 0x55, 0x6a, 0x33, 0x43, 0x8d, 0xb8, 0x7b, 0xc4, 0x1b, 0x17, 0x52, 0xc5, 0x5e, 0x5e, 0x49 }; - char iv1[BLOCK_SIZE]; - char key1[KEY_SIZE] = { 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - char plaintext2[BLOCK_SIZE] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00 }; - char ciphertext2[BLOCK_SIZE] = { 0xb7, 0x97, 0x2b, 0x39, 0x41, 0xc4, 0x4b, 0x90, 0xaf, 0xa7, 0xb2, 0x64, 0xbf, 0xba, 0x73, 0x87 }; - char iv2[BLOCK_SIZE]; - char key2[KEY_SIZE]; + uint8_t plaintext1[BLOCK_SIZE]; + uint8_t ciphertext1[BLOCK_SIZE] = { 0xdf, 0x55, 0x6a, 0x33, 0x43, 0x8d, 0xb8, 0x7b, 0xc4, 0x1b, 0x17, 0x52, 0xc5, 0x5e, 0x5e, 0x49 }; + uint8_t iv1[BLOCK_SIZE]; + uint8_t key1[KEY_SIZE] = { 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + uint8_t plaintext2[BLOCK_SIZE] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00 }; + uint8_t ciphertext2[BLOCK_SIZE] = { 0xb7, 0x97, 0x2b, 0x39, 0x41, 0xc4, 0x4b, 0x90, 0xaf, 0xa7, 0xb2, 0x64, 0xbf, 0xba, 0x73, 0x87 }; + uint8_t iv2[BLOCK_SIZE]; + uint8_t key2[KEY_SIZE]; struct session_op sess; struct crypt_op cryp; -- cgit