diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2010-07-07 19:33:33 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2010-07-07 19:33:33 +0200 |
commit | b673efed4a10dc31567b1c29b140b7910daeaf95 (patch) | |
tree | 9dbd383a19543719bf6f3e25b7c3259aa1f461f6 /examples/cipher.c | |
parent | 4334f22638344873c4361f663be9d3dcad2b6bc4 (diff) | |
download | cryptodev-linux-b673efed4a10dc31567b1c29b140b7910daeaf95.tar.gz cryptodev-linux-b673efed4a10dc31567b1c29b140b7910daeaf95.tar.xz cryptodev-linux-b673efed4a10dc31567b1c29b140b7910daeaf95.zip |
Public and private keys are being generated in a new workqueue. Some other fixes and optimizations.
Diffstat (limited to 'examples/cipher.c')
-rw-r--r-- | examples/cipher.c | 24 |
1 files changed, 12 insertions, 12 deletions
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; |