]> code.ossystems Code Review - meta-freescale.git/blob
133d46c10fa47270ff90e7c9601f3653579ce0ef
[meta-freescale.git] /
1 From 5f3a9153f7685f6dde29f7cd2d58534126c5b9af Mon Sep 17 00:00:00 2001
2 From: Cristian Stoica <cristian.stoica@nxp.com>
3 Date: Wed, 26 Oct 2016 10:45:40 +0300
4 Subject: [PATCH 063/104] avoid implicit conversion between signed and unsigned
5  char
6
7 Signed-off-by: Cristian Stoica <cristian.stoica@nxp.com>
8 ---
9  tests/async_cipher.c     | 36 ++++++++++++++--------------
10  tests/async_hmac.c       |  8 +++----
11  tests/async_speed.c      |  2 +-
12  tests/cipher-aead-srtp.c | 50 +++++++++++++++++++-------------------
13  tests/cipher-aead.c      | 48 ++++++++++++++++++-------------------
14  tests/cipher-gcm.c       | 62 ++++++++++++++++++++++++------------------------
15  tests/cipher.c           | 35 ++++++++++++++-------------
16  tests/cipher_comp.c      | 12 +++++-----
17  tests/fullspeed.c        |  3 ++-
18  tests/hash_comp.c        |  8 +++----
19  tests/hmac.c             |  8 +++----
20  tests/speed.c            |  3 ++-
21  12 files changed, 138 insertions(+), 137 deletions(-)
22
23 diff --git a/tests/async_cipher.c b/tests/async_cipher.c
24 index 162a695..dd08403 100644
25 --- a/tests/async_cipher.c
26 +++ b/tests/async_cipher.c
27 @@ -9,7 +9,7 @@
28  #include <string.h>
29  #include <unistd.h>
30  #include <fcntl.h>
31 -
32 +#include <stdint.h>
33  #include <sys/ioctl.h>
34  #include <crypto/cryptodev.h>
35  
36 @@ -26,10 +26,10 @@ static int debug = 0;
37  static int
38  test_crypto(int cfd)
39  {
40 -       char plaintext_raw[DATA_SIZE + 63], *plaintext;
41 -       char ciphertext_raw[DATA_SIZE + 63], *ciphertext;
42 -       char iv[BLOCK_SIZE];
43 -       char key[KEY_SIZE];
44 +       uint8_t plaintext_raw[DATA_SIZE + 63], *plaintext;
45 +       uint8_t ciphertext_raw[DATA_SIZE + 63], *ciphertext;
46 +       uint8_t iv[BLOCK_SIZE];
47 +       uint8_t key[KEY_SIZE];
48  
49         struct session_op sess;
50  #ifdef CIOCGSESSINFO
51 @@ -62,8 +62,8 @@ test_crypto(int cfd)
52                 perror("ioctl(CIOCGSESSINFO)");
53                 return 1;
54         }
55 -       plaintext = (char *)(((unsigned long)plaintext_raw + siop.alignmask) & ~siop.alignmask);
56 -       ciphertext = (char *)(((unsigned long)ciphertext_raw + siop.alignmask) & ~siop.alignmask);
57 +       plaintext = (uint8_t *)(((unsigned long)plaintext_raw + siop.alignmask) & ~siop.alignmask);
58 +       ciphertext = (uint8_t *)(((unsigned long)ciphertext_raw + siop.alignmask) & ~siop.alignmask);
59  #else
60         plaintext = plaintext_raw;
61         ciphertext = ciphertext_raw;
62 @@ -127,15 +127,15 @@ test_crypto(int cfd)
63  
64  static int test_aes(int cfd)
65  {
66 -       char plaintext1_raw[BLOCK_SIZE + 63], *plaintext1;
67 -       char ciphertext1[BLOCK_SIZE] = { 0xdf, 0x55, 0x6a, 0x33, 0x43, 0x8d, 0xb8, 0x7b, 0xc4, 0x1b, 0x17, 0x52, 0xc5, 0x5e, 0x5e, 0x49 };
68 -       char iv1[BLOCK_SIZE];
69 -       char key1[KEY_SIZE] = { 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
70 -       char plaintext2_data[BLOCK_SIZE] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00 };
71 -       char plaintext2_raw[BLOCK_SIZE + 63], *plaintext2;
72 -       char ciphertext2[BLOCK_SIZE] = { 0xb7, 0x97, 0x2b, 0x39, 0x41, 0xc4, 0x4b, 0x90, 0xaf, 0xa7, 0xb2, 0x64, 0xbf, 0xba, 0x73, 0x87 };
73 -       char iv2[BLOCK_SIZE];
74 -       char key2[KEY_SIZE];
75 +       uint8_t plaintext1_raw[BLOCK_SIZE + 63], *plaintext1;
76 +       uint8_t ciphertext1[BLOCK_SIZE] = { 0xdf, 0x55, 0x6a, 0x33, 0x43, 0x8d, 0xb8, 0x7b, 0xc4, 0x1b, 0x17, 0x52, 0xc5, 0x5e, 0x5e, 0x49 };
77 +       uint8_t iv1[BLOCK_SIZE];
78 +       uint8_t key1[KEY_SIZE] = { 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
79 +       uint8_t plaintext2_data[BLOCK_SIZE] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00 };
80 +       uint8_t plaintext2_raw[BLOCK_SIZE + 63], *plaintext2;
81 +       uint8_t ciphertext2[BLOCK_SIZE] = { 0xb7, 0x97, 0x2b, 0x39, 0x41, 0xc4, 0x4b, 0x90, 0xaf, 0xa7, 0xb2, 0x64, 0xbf, 0xba, 0x73, 0x87 };
82 +       uint8_t iv2[BLOCK_SIZE];
83 +       uint8_t key2[KEY_SIZE];
84  
85         struct session_op sess1, sess2;
86  #ifdef CIOCGSESSINFO
87 @@ -162,7 +162,7 @@ static int test_aes(int cfd)
88                 perror("ioctl(CIOCGSESSINFO)");
89                 return 1;
90         }
91 -       plaintext1 = (char *)(((unsigned long)plaintext1_raw + siop1.alignmask) & ~siop1.alignmask);
92 +       plaintext1 = (uint8_t *)(((unsigned long)plaintext1_raw + siop1.alignmask) & ~siop1.alignmask);
93  #else
94         plaintext1 = plaintext1_raw;
95  #endif
96 @@ -185,7 +185,7 @@ static int test_aes(int cfd)
97                 perror("ioctl(CIOCGSESSINFO)");
98                 return 1;
99         }
100 -       plaintext2 = (char *)(((unsigned long)plaintext2_raw + siop2.alignmask) & ~siop2.alignmask);
101 +       plaintext2 = (uint8_t *)(((unsigned long)plaintext2_raw + siop2.alignmask) & ~siop2.alignmask);
102  #else
103         plaintext2 = plaintext2_raw;
104  #endif
105 diff --git a/tests/async_hmac.c b/tests/async_hmac.c
106 index 97fd0c5..94a02c0 100644
107 --- a/tests/async_hmac.c
108 +++ b/tests/async_hmac.c
109 @@ -61,7 +61,7 @@ test_crypto(int cfd)
110  
111         cryp.ses = sess.ses;
112         cryp.len = sizeof("what do ya want for nothing?")-1;
113 -       cryp.src = "what do ya want for nothing?";
114 +       cryp.src = (uint8_t*)"what do ya want for nothing?";
115         cryp.mac = mac;
116         cryp.op = COP_ENCRYPT;
117  
118 @@ -98,7 +98,7 @@ test_crypto(int cfd)
119  
120         cryp.ses = sess.ses;
121         cryp.len = sizeof("what do ya want for nothing?")-1;
122 -       cryp.src = "what do ya want for nothing?";
123 +       cryp.src = (uint8_t*)"what do ya want for nothing?";
124         cryp.mac = mac;
125         cryp.op = COP_ENCRYPT;
126  
127 @@ -208,7 +208,7 @@ test_extras(int cfd)
128  
129         cryp.ses = sess.ses;
130         cryp.len = sizeof("what do")-1;
131 -       cryp.src = "what do";
132 +       cryp.src = (uint8_t*)"what do";
133         cryp.mac = mac;
134         cryp.op = COP_ENCRYPT;
135         cryp.flags = COP_FLAG_UPDATE;
136 @@ -218,7 +218,7 @@ test_extras(int cfd)
137  
138         cryp.ses = sess.ses;
139         cryp.len = sizeof(" ya want for nothing?")-1;
140 -       cryp.src = " ya want for nothing?";
141 +       cryp.src = (uint8_t*)" ya want for nothing?";
142         cryp.mac = mac;
143         cryp.op = COP_ENCRYPT;
144         cryp.flags = COP_FLAG_FINAL;
145 diff --git a/tests/async_speed.c b/tests/async_speed.c
146 index a1a1b7e..dabbbc1 100644
147 --- a/tests/async_speed.c
148 +++ b/tests/async_speed.c
149 @@ -140,7 +140,7 @@ int encrypt_data(int fdc, struct test_params tp, struct session_op *sess)
150  {
151         struct crypt_op cop;
152         char *buffer[64], iv[32];
153 -       char mac[64][HASH_MAX_LEN];
154 +       uint8_t mac[64][HASH_MAX_LEN];
155         static int val = 23;
156         struct timeval start, end;
157         uint64_t total = 0;
158 diff --git a/tests/cipher-aead-srtp.c b/tests/cipher-aead-srtp.c
159 index fae04e7..c44877d 100644
160 --- a/tests/cipher-aead-srtp.c
161 +++ b/tests/cipher-aead-srtp.c
162 @@ -77,13 +77,13 @@ int i;
163  static int
164  test_crypto(int cfd)
165  {
166 -       char plaintext_raw[DATA_SIZE + 63], *plaintext;
167 -       char ciphertext_raw[DATA_SIZE + 63], *ciphertext;
168 -       char iv[BLOCK_SIZE];
169 -       char key[KEY_SIZE];
170 -       unsigned char sha1mac[20];
171 -       unsigned char tag[20];
172 -       unsigned char mackey[] = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b";
173 +       uint8_t plaintext_raw[DATA_SIZE + 63], *plaintext;
174 +       uint8_t ciphertext_raw[DATA_SIZE + 63], *ciphertext;
175 +       uint8_t iv[BLOCK_SIZE];
176 +       uint8_t key[KEY_SIZE];
177 +       uint8_t sha1mac[20];
178 +       uint8_t tag[20];
179 +       uint8_t mackey[] = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b";
180         int mackey_len = 16;
181  
182         struct session_op sess;
183 @@ -122,8 +122,8 @@ test_crypto(int cfd)
184                 printf("requested cipher CRYPTO_AES_CBC/HMAC-SHA1, got %s with driver %s\n",
185                         siop.cipher_info.cra_name, siop.cipher_info.cra_driver_name);
186  
187 -       plaintext = (char *)(((unsigned long)plaintext_raw + siop.alignmask) & ~siop.alignmask);
188 -       ciphertext = (char *)(((unsigned long)ciphertext_raw + siop.alignmask) & ~siop.alignmask);
189 +       plaintext = (uint8_t *)(((unsigned long)plaintext_raw + siop.alignmask) & ~siop.alignmask);
190 +       ciphertext = (uint8_t *)(((unsigned long)ciphertext_raw + siop.alignmask) & ~siop.alignmask);
191  
192         memset(plaintext, 0x15, HEADER_SIZE); /* header */
193         memset(&plaintext[HEADER_SIZE], 0x17, PLAINTEXT_SIZE); /* payload */
194 @@ -225,12 +225,12 @@ test_crypto(int cfd)
195  static int
196  test_encrypt_decrypt(int cfd)
197  {
198 -       char plaintext_raw[DATA_SIZE + 63], *plaintext;
199 -       char ciphertext_raw[DATA_SIZE + 63], *ciphertext;
200 -       char iv[BLOCK_SIZE];
201 -       char key[KEY_SIZE];
202 -       unsigned char tag[20];
203 -       unsigned char mackey[] = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b";
204 +       uint8_t plaintext_raw[DATA_SIZE + 63], *plaintext;
205 +       uint8_t ciphertext_raw[DATA_SIZE + 63], *ciphertext;
206 +       uint8_t iv[BLOCK_SIZE];
207 +       uint8_t key[KEY_SIZE];
208 +       uint8_t tag[20];
209 +       uint8_t mackey[] = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b";
210         int mackey_len = 16;
211  
212         struct session_op sess;
213 @@ -265,8 +265,8 @@ test_encrypt_decrypt(int cfd)
214  //     printf("requested cipher CRYPTO_AES_CBC/HMAC-SHA1, got %s with driver %s\n",
215  //                     siop.cipher_info.cra_name, siop.cipher_info.cra_driver_name);
216  
217 -       plaintext = (char *)(((unsigned long)plaintext_raw + siop.alignmask) & ~siop.alignmask);
218 -       ciphertext = (char *)(((unsigned long)ciphertext_raw + siop.alignmask) & ~siop.alignmask);
219 +       plaintext = (uint8_t *)(((unsigned long)plaintext_raw + siop.alignmask) & ~siop.alignmask);
220 +       ciphertext = (uint8_t *)(((unsigned long)ciphertext_raw + siop.alignmask) & ~siop.alignmask);
221  
222         memset(plaintext, 0x15, HEADER_SIZE); /* header */
223         memset(&plaintext[HEADER_SIZE], 0x17, PLAINTEXT_SIZE); /* payload */
224 @@ -367,12 +367,12 @@ test_encrypt_decrypt(int cfd)
225  static int
226  test_encrypt_decrypt_error(int cfd, int err)
227  {
228 -       char plaintext_raw[DATA_SIZE + 63], *plaintext;
229 -       char ciphertext_raw[DATA_SIZE + 63], *ciphertext;
230 -       char iv[BLOCK_SIZE];
231 -       char key[KEY_SIZE];
232 -       unsigned char tag[20];
233 -       unsigned char mackey[] = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b";
234 +       uint8_t plaintext_raw[DATA_SIZE + 63], *plaintext;
235 +       uint8_t ciphertext_raw[DATA_SIZE + 63], *ciphertext;
236 +       uint8_t iv[BLOCK_SIZE];
237 +       uint8_t key[KEY_SIZE];
238 +       uint8_t tag[20];
239 +       uint8_t mackey[] = "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b";
240         int mackey_len = 16;
241  
242         struct session_op sess;
243 @@ -407,8 +407,8 @@ test_encrypt_decrypt_error(int cfd, int err)
244  //     printf("requested cipher CRYPTO_AES_CBC/HMAC-SHA1, got %s with driver %s\n",
245  //                     siop.cipher_info.cra_name, siop.cipher_info.cra_driver_name);
246  
247 -       plaintext = (char *)(((unsigned long)plaintext_raw + siop.alignmask) & ~siop.alignmask);
248 -       ciphertext = (char *)(((unsigned long)ciphertext_raw + siop.alignmask) & ~siop.alignmask);
249 +       plaintext = (uint8_t *)(((unsigned long)plaintext_raw + siop.alignmask) & ~siop.alignmask);
250 +       ciphertext = (uint8_t *)(((unsigned long)ciphertext_raw + siop.alignmask) & ~siop.alignmask);
251  
252         memset(plaintext, 0x15, HEADER_SIZE); /* header */
253         memset(&plaintext[HEADER_SIZE], 0x17, PLAINTEXT_SIZE); /* payload */
254 diff --git a/tests/cipher-aead.c b/tests/cipher-aead.c
255 index 164327f..da43aa6 100644
256 --- a/tests/cipher-aead.c
257 +++ b/tests/cipher-aead.c
258 @@ -89,12 +89,12 @@ int i;
259  static int
260  test_crypto(int cfd)
261  {
262 -       char plaintext_raw[DATA_SIZE + 63], *plaintext;
263 -       char ciphertext_raw[DATA_SIZE + 63], *ciphertext;
264 -       char iv[BLOCK_SIZE];
265 -       char key[KEY_SIZE];
266 -       char auth[AUTH_SIZE];
267 -       unsigned char sha1mac[20];
268 +       uint8_t plaintext_raw[DATA_SIZE + 63], *plaintext;
269 +       uint8_t ciphertext_raw[DATA_SIZE + 63], *ciphertext;
270 +       uint8_t iv[BLOCK_SIZE];
271 +       uint8_t key[KEY_SIZE];
272 +       uint8_t auth[AUTH_SIZE];
273 +       uint8_t sha1mac[20];
274         int pad, i;
275  
276         struct session_op sess;
277 @@ -133,8 +133,8 @@ test_crypto(int cfd)
278                 printf("requested cipher CRYPTO_AES_CBC/HMAC-SHA1, got %s with driver %s\n",
279                         siop.cipher_info.cra_name, siop.cipher_info.cra_driver_name);
280  
281 -       plaintext = (char *)(((unsigned long)plaintext_raw + siop.alignmask) & ~siop.alignmask);
282 -       ciphertext = (char *)(((unsigned long)ciphertext_raw + siop.alignmask) & ~siop.alignmask);
283 +       plaintext = (uint8_t *)(((unsigned long)plaintext_raw + siop.alignmask) & ~siop.alignmask);
284 +       ciphertext = (uint8_t *)(((unsigned long)ciphertext_raw + siop.alignmask) & ~siop.alignmask);
285         memset(plaintext, 0x15, DATA_SIZE);
286  
287         if (get_sha1_hmac(cfd, sess.mackey, sess.mackeylen, auth, sizeof(auth), plaintext, DATA_SIZE, sha1mac) != 0) {
288 @@ -242,12 +242,12 @@ test_crypto(int cfd)
289  static int
290  test_encrypt_decrypt(int cfd)
291  {
292 -       char plaintext_raw[DATA_SIZE + 63], *plaintext;
293 -       char ciphertext_raw[DATA_SIZE + 63], *ciphertext;
294 -       char iv[BLOCK_SIZE];
295 -       char key[KEY_SIZE];
296 -       char auth[AUTH_SIZE];
297 -       unsigned char sha1mac[20];
298 +       uint8_t plaintext_raw[DATA_SIZE + 63], *plaintext;
299 +       uint8_t ciphertext_raw[DATA_SIZE + 63], *ciphertext;
300 +       uint8_t iv[BLOCK_SIZE];
301 +       uint8_t key[KEY_SIZE];
302 +       uint8_t auth[AUTH_SIZE];
303 +       uint8_t sha1mac[20];
304         int enc_len;
305  
306         struct session_op sess;
307 @@ -285,8 +285,8 @@ test_encrypt_decrypt(int cfd)
308  //     printf("requested cipher CRYPTO_AES_CBC/HMAC-SHA1, got %s with driver %s\n",
309  //                     siop.cipher_info.cra_name, siop.cipher_info.cra_driver_name);
310  
311 -       plaintext = (char *)(((unsigned long)plaintext_raw + siop.alignmask) & ~siop.alignmask);
312 -       ciphertext = (char *)(((unsigned long)ciphertext_raw + siop.alignmask) & ~siop.alignmask);
313 +       plaintext = (uint8_t *)(((unsigned long)plaintext_raw + siop.alignmask) & ~siop.alignmask);
314 +       ciphertext = (uint8_t *)(((unsigned long)ciphertext_raw + siop.alignmask) & ~siop.alignmask);
315  
316         memset(plaintext, 0x15, DATA_SIZE);
317  
318 @@ -391,12 +391,12 @@ test_encrypt_decrypt(int cfd)
319  static int
320  test_encrypt_decrypt_error(int cfd, int err)
321  {
322 -       char plaintext_raw[DATA_SIZE + 63], *plaintext;
323 -       char ciphertext_raw[DATA_SIZE + 63], *ciphertext;
324 -       char iv[BLOCK_SIZE];
325 -       char key[KEY_SIZE];
326 -       char auth[AUTH_SIZE];
327 -       unsigned char sha1mac[20];
328 +       uint8_t plaintext_raw[DATA_SIZE + 63], *plaintext;
329 +       uint8_t ciphertext_raw[DATA_SIZE + 63], *ciphertext;
330 +       uint8_t iv[BLOCK_SIZE];
331 +       uint8_t key[KEY_SIZE];
332 +       uint8_t auth[AUTH_SIZE];
333 +       uint8_t sha1mac[20];
334         int enc_len;
335  
336         struct session_op sess;
337 @@ -434,8 +434,8 @@ test_encrypt_decrypt_error(int cfd, int err)
338  //     printf("requested cipher CRYPTO_AES_CBC/HMAC-SHA1, got %s with driver %s\n",
339  //                     siop.cipher_info.cra_name, siop.cipher_info.cra_driver_name);
340  
341 -       plaintext = (char *)(((unsigned long)plaintext_raw + siop.alignmask) & ~siop.alignmask);
342 -       ciphertext = (char *)(((unsigned long)ciphertext_raw + siop.alignmask) & ~siop.alignmask);
343 +       plaintext = (uint8_t *)(((unsigned long)plaintext_raw + siop.alignmask) & ~siop.alignmask);
344 +       ciphertext = (uint8_t *)(((unsigned long)ciphertext_raw + siop.alignmask) & ~siop.alignmask);
345         memset(plaintext, 0x15, DATA_SIZE);
346  
347         if (get_sha1_hmac(cfd, sess.mackey, sess.mackeylen, auth, sizeof(auth), plaintext, DATA_SIZE, sha1mac) != 0) {
348 diff --git a/tests/cipher-gcm.c b/tests/cipher-gcm.c
349 index dfc3d84..3f6cc7b 100644
350 --- a/tests/cipher-gcm.c
351 +++ b/tests/cipher-gcm.c
352 @@ -45,45 +45,45 @@ struct aes_gcm_vectors_st {
353  
354  struct aes_gcm_vectors_st aes_gcm_vectors[] = {
355         {
356 -        .key =
357 +        .key = (uint8_t*)
358          "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
359          .auth = NULL,
360          .auth_size = 0,
361 -        .plaintext =
362 +        .plaintext = (uint8_t*)
363          "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
364          .plaintext_size = 16,
365 -        .ciphertext =
366 +        .ciphertext = (uint8_t*)
367          "\x03\x88\xda\xce\x60\xb6\xa3\x92\xf3\x28\xc2\xb9\x71\xb2\xfe\x78",
368 -        .iv = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
369 -        .tag =
370 +        .iv = (uint8_t*)"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
371 +        .tag = (uint8_t*)
372          "\xab\x6e\x47\xd4\x2c\xec\x13\xbd\xf5\x3a\x67\xb2\x12\x57\xbd\xdf"
373         },
374         {
375 -        .key =
376 +        .key = (uint8_t*)
377          "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08",
378          .auth = NULL,
379          .auth_size = 0,
380 -        .plaintext =
381 +        .plaintext = (uint8_t*)
382          "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d\xe6\x57\xba\x63\x7b\x39\x1a\xaf\xd2\x55",
383          .plaintext_size = 64,
384 -        .ciphertext =
385 +        .ciphertext = (uint8_t*)
386          "\x42\x83\x1e\xc2\x21\x77\x74\x24\x4b\x72\x21\xb7\x84\xd0\xd4\x9c\xe3\xaa\x21\x2f\x2c\x02\xa4\xe0\x35\xc1\x7e\x23\x29\xac\xa1\x2e\x21\xd5\x14\xb2\x54\x66\x93\x1c\x7d\x8f\x6a\x5a\xac\x84\xaa\x05\x1b\xa3\x0b\x39\x6a\x0a\xac\x97\x3d\x58\xe0\x91\x47\x3f\x59\x85",
387 -        .iv = "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88",
388 -        .tag = "\x4d\x5c\x2a\xf3\x27\xcd\x64\xa6\x2c\xf3\x5a\xbd\x2b\xa6\xfa\xb4"
389 +        .iv = (uint8_t*)"\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88",
390 +        .tag = (uint8_t*)"\x4d\x5c\x2a\xf3\x27\xcd\x64\xa6\x2c\xf3\x5a\xbd\x2b\xa6\xfa\xb4"
391         },
392         {
393 -        .key =
394 +        .key = (uint8_t*)
395          "\xfe\xff\xe9\x92\x86\x65\x73\x1c\x6d\x6a\x8f\x94\x67\x30\x83\x08",
396 -        .auth =
397 +        .auth = (uint8_t*)
398          "\xfe\xed\xfa\xce\xde\xad\xbe\xef\xfe\xed\xfa\xce\xde\xad\xbe\xef\xab\xad\xda\xd2",
399          .auth_size = 20,
400 -        .plaintext =
401 +        .plaintext = (uint8_t*)
402          "\xd9\x31\x32\x25\xf8\x84\x06\xe5\xa5\x59\x09\xc5\xaf\xf5\x26\x9a\x86\xa7\xa9\x53\x15\x34\xf7\xda\x2e\x4c\x30\x3d\x8a\x31\x8a\x72\x1c\x3c\x0c\x95\x95\x68\x09\x53\x2f\xcf\x0e\x24\x49\xa6\xb5\x25\xb1\x6a\xed\xf5\xaa\x0d\xe6\x57\xba\x63\x7b\x39",
403          .plaintext_size = 60,
404 -        .ciphertext =
405 +        .ciphertext = (uint8_t*)
406          "\x42\x83\x1e\xc2\x21\x77\x74\x24\x4b\x72\x21\xb7\x84\xd0\xd4\x9c\xe3\xaa\x21\x2f\x2c\x02\xa4\xe0\x35\xc1\x7e\x23\x29\xac\xa1\x2e\x21\xd5\x14\xb2\x54\x66\x93\x1c\x7d\x8f\x6a\x5a\xac\x84\xaa\x05\x1b\xa3\x0b\x39\x6a\x0a\xac\x97\x3d\x58\xe0\x91",
407 -        .iv = "\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88",
408 -        .tag =
409 +        .iv = (uint8_t*)"\xca\xfe\xba\xbe\xfa\xce\xdb\xad\xde\xca\xf8\x88",
410 +        .tag = (uint8_t*)
411          "\x5b\xc9\x4f\xbc\x32\x21\xa5\xdb\x94\xfa\xe9\x5a\xe7\x12\x1a\x47"
412         }
413  };
414 @@ -94,7 +94,7 @@ struct aes_gcm_vectors_st aes_gcm_vectors[] = {
415  static int test_crypto(int cfd)
416  {
417         int i;
418 -       int8_t tmp[128];
419 +       uint8_t tmp[128];
420  
421         struct session_op sess;
422         struct crypt_auth_op cao;
423 @@ -191,11 +191,11 @@ static int test_crypto(int cfd)
424   */
425  static int test_encrypt_decrypt(int cfd)
426  {
427 -       char plaintext_raw[DATA_SIZE + 63], *plaintext;
428 -       char ciphertext_raw[DATA_SIZE + 63], *ciphertext;
429 -       char iv[BLOCK_SIZE];
430 -       char key[KEY_SIZE];
431 -       char auth[AUTH_SIZE];
432 +       uint8_t plaintext_raw[DATA_SIZE + 63], *plaintext;
433 +       uint8_t ciphertext_raw[DATA_SIZE + 63], *ciphertext;
434 +       uint8_t iv[BLOCK_SIZE];
435 +       uint8_t key[KEY_SIZE];
436 +       uint8_t auth[AUTH_SIZE];
437         int enc_len;
438  
439         struct session_op sess;
440 @@ -233,10 +233,10 @@ static int test_encrypt_decrypt(int cfd)
441  //                      siop.cipher_info.cra_name, siop.cipher_info.cra_driver_name);
442  
443         plaintext =
444 -           (char *) (((unsigned long) plaintext_raw + siop.alignmask) &
445 +           (uint8_t *) (((unsigned long) plaintext_raw + siop.alignmask) &
446                       ~siop.alignmask);
447         ciphertext =
448 -           (char *) (((unsigned long) ciphertext_raw + siop.alignmask) &
449 +           (uint8_t *) (((unsigned long) ciphertext_raw + siop.alignmask) &
450                       ~siop.alignmask);
451  
452         memset(plaintext, 0x15, DATA_SIZE);
453 @@ -336,11 +336,11 @@ static int test_encrypt_decrypt(int cfd)
454  
455  static int test_encrypt_decrypt_error(int cfd, int err)
456  {
457 -       char plaintext_raw[DATA_SIZE + 63], *plaintext;
458 -       char ciphertext_raw[DATA_SIZE + 63], *ciphertext;
459 -       char iv[BLOCK_SIZE];
460 -       char key[KEY_SIZE];
461 -       char auth[AUTH_SIZE];
462 +       uint8_t plaintext_raw[DATA_SIZE + 63], *plaintext;
463 +       uint8_t ciphertext_raw[DATA_SIZE + 63], *ciphertext;
464 +       uint8_t iv[BLOCK_SIZE];
465 +       uint8_t key[KEY_SIZE];
466 +       uint8_t auth[AUTH_SIZE];
467         int enc_len;
468  
469         struct session_op sess;
470 @@ -386,10 +386,10 @@ static int test_encrypt_decrypt_error(int cfd, int err)
471  //                      siop.cipher_info.cra_name, siop.cipher_info.cra_driver_name);
472  
473         plaintext =
474 -           (char *) (((unsigned long) plaintext_raw + siop.alignmask) &
475 +           (uint8_t *) (((unsigned long) plaintext_raw + siop.alignmask) &
476                       ~siop.alignmask);
477         ciphertext =
478 -           (char *) (((unsigned long) ciphertext_raw + siop.alignmask) &
479 +           (uint8_t *) (((unsigned long) ciphertext_raw + siop.alignmask) &
480                       ~siop.alignmask);
481  
482         memset(plaintext, 0x15, DATA_SIZE);
483 diff --git a/tests/cipher.c b/tests/cipher.c
484 index 07144f2..f3ca2f0 100644
485 --- a/tests/cipher.c
486 +++ b/tests/cipher.c
487 @@ -8,6 +8,7 @@
488  #include <string.h>
489  #include <unistd.h>
490  #include <fcntl.h>
491 +#include <stdint.h>
492  
493  #include <sys/ioctl.h>
494  #include <crypto/cryptodev.h>
495 @@ -21,10 +22,10 @@ static int debug = 0;
496  static int
497  test_crypto(int cfd)
498  {
499 -       char plaintext_raw[DATA_SIZE + 63], *plaintext;
500 -       char ciphertext_raw[DATA_SIZE + 63], *ciphertext;
501 -       char iv[BLOCK_SIZE];
502 -       char key[KEY_SIZE];
503 +       uint8_t plaintext_raw[DATA_SIZE + 63], *plaintext;
504 +       uint8_t ciphertext_raw[DATA_SIZE + 63], *ciphertext;
505 +       uint8_t iv[BLOCK_SIZE];
506 +       uint8_t key[KEY_SIZE];
507  
508         struct session_op sess;
509  #ifdef CIOCGSESSINFO
510 @@ -57,8 +58,8 @@ test_crypto(int cfd)
511                 printf("requested cipher CRYPTO_AES_CBC, got %s with driver %s\n",
512                         siop.cipher_info.cra_name, siop.cipher_info.cra_driver_name);
513  
514 -       plaintext = (char *)(((unsigned long)plaintext_raw + siop.alignmask) & ~siop.alignmask);
515 -       ciphertext = (char *)(((unsigned long)ciphertext_raw + siop.alignmask) & ~siop.alignmask);
516 +       plaintext = (uint8_t *)(((unsigned long)plaintext_raw + siop.alignmask) & ~siop.alignmask);
517 +       ciphertext = (uint8_t *)(((unsigned long)ciphertext_raw + siop.alignmask) & ~siop.alignmask);
518  #else
519         plaintext = plaintext_raw;
520         ciphertext = ciphertext_raw;
521 @@ -143,15 +144,15 @@ test_crypto(int cfd)
522  
523  static int test_aes(int cfd)
524  {
525 -       char plaintext1_raw[BLOCK_SIZE + 63], *plaintext1;
526 -       char ciphertext1[BLOCK_SIZE] = { 0xdf, 0x55, 0x6a, 0x33, 0x43, 0x8d, 0xb8, 0x7b, 0xc4, 0x1b, 0x17, 0x52, 0xc5, 0x5e, 0x5e, 0x49 };
527 -       char iv1[BLOCK_SIZE];
528 -       char key1[KEY_SIZE] = { 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
529 -       char plaintext2_data[BLOCK_SIZE] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00 };
530 -       char plaintext2_raw[BLOCK_SIZE + 63], *plaintext2;
531 -       char ciphertext2[BLOCK_SIZE] = { 0xb7, 0x97, 0x2b, 0x39, 0x41, 0xc4, 0x4b, 0x90, 0xaf, 0xa7, 0xb2, 0x64, 0xbf, 0xba, 0x73, 0x87 };
532 -       char iv2[BLOCK_SIZE];
533 -       char key2[KEY_SIZE];
534 +       uint8_t plaintext1_raw[BLOCK_SIZE + 63], *plaintext1;
535 +       uint8_t ciphertext1[BLOCK_SIZE] = { 0xdf, 0x55, 0x6a, 0x33, 0x43, 0x8d, 0xb8, 0x7b, 0xc4, 0x1b, 0x17, 0x52, 0xc5, 0x5e, 0x5e, 0x49 };
536 +       uint8_t iv1[BLOCK_SIZE];
537 +       uint8_t key1[KEY_SIZE] = { 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
538 +       uint8_t plaintext2_data[BLOCK_SIZE] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00 };
539 +       uint8_t plaintext2_raw[BLOCK_SIZE + 63], *plaintext2;
540 +       uint8_t ciphertext2[BLOCK_SIZE] = { 0xb7, 0x97, 0x2b, 0x39, 0x41, 0xc4, 0x4b, 0x90, 0xaf, 0xa7, 0xb2, 0x64, 0xbf, 0xba, 0x73, 0x87 };
541 +       uint8_t iv2[BLOCK_SIZE];
542 +       uint8_t key2[KEY_SIZE];
543  
544         struct session_op sess;
545  #ifdef CIOCGSESSINFO
546 @@ -176,7 +177,7 @@ static int test_aes(int cfd)
547                 perror("ioctl(CIOCGSESSINFO)");
548                 return 1;
549         }
550 -       plaintext1 = (char *)(((unsigned long)plaintext1_raw + siop.alignmask) & ~siop.alignmask);
551 +       plaintext1 = (uint8_t *)(((unsigned long)plaintext1_raw + siop.alignmask) & ~siop.alignmask);
552  #else
553         plaintext1 = plaintext1_raw;
554  #endif
555 @@ -226,7 +227,7 @@ static int test_aes(int cfd)
556                 printf("requested cipher CRYPTO_AES_CBC, got %s with driver %s\n",
557                         siop.cipher_info.cra_name, siop.cipher_info.cra_driver_name);
558  
559 -       plaintext2 = (char *)(((unsigned long)plaintext2_raw + siop.alignmask) & ~siop.alignmask);
560 +       plaintext2 = (uint8_t *)(((unsigned long)plaintext2_raw + siop.alignmask) & ~siop.alignmask);
561  #else
562         plaintext2 = plaintext2_raw;
563  #endif
564 diff --git a/tests/cipher_comp.c b/tests/cipher_comp.c
565 index b2bc5af..03f67bf 100644
566 --- a/tests/cipher_comp.c
567 +++ b/tests/cipher_comp.c
568 @@ -24,12 +24,12 @@
569  static int
570  test_crypto(int cfd, struct session_op *sess, int datalen)
571  {
572 -       char *data, *encrypted;
573 -       char *encrypted_comp;
574 +       uint8_t *data, *encrypted;
575 +       uint8_t *encrypted_comp;
576  
577 -       char iv_in[BLOCK_SIZE];
578 -       char iv[BLOCK_SIZE];
579 -       char iv_comp[BLOCK_SIZE];
580 +       uint8_t iv_in[BLOCK_SIZE];
581 +       uint8_t iv[BLOCK_SIZE];
582 +       uint8_t iv_comp[BLOCK_SIZE];
583  
584         struct crypt_op cryp;
585  
586 @@ -90,7 +90,7 @@ main(int argc, char **argv)
587  {
588         int fd;
589         struct session_op sess;
590 -       unsigned char key[KEY_SIZE];
591 +       uint8_t key[KEY_SIZE];
592         int datalen = BLOCK_SIZE;
593         int datalen_end = MAX_DATALEN;
594         int i;
595 diff --git a/tests/fullspeed.c b/tests/fullspeed.c
596 index 611859d..c025130 100644
597 --- a/tests/fullspeed.c
598 +++ b/tests/fullspeed.c
599 @@ -25,6 +25,7 @@
600  #include <sys/types.h>
601  #include <signal.h>
602  #include <unistd.h>
603 +#include <stdint.h>
604  
605  #include <crypto/cryptodev.h>
606  
607 @@ -74,7 +75,7 @@ static void value2human(int si, double bytes, double time, double* data, double*
608  int encrypt_data(int algo, void* keybuf, int key_size, int fdc, int chunksize)
609  {
610         struct crypt_op cop;
611 -       char *buffer, iv[32];
612 +       uint8_t *buffer, iv[32];
613         static int val = 23;
614         struct timeval start, end;
615         double total = 0;
616 diff --git a/tests/hash_comp.c b/tests/hash_comp.c
617 index 9e700a1..e6a4346 100644
618 --- a/tests/hash_comp.c
619 +++ b/tests/hash_comp.c
620 @@ -30,11 +30,9 @@ static void printhex(unsigned char *buf, int buflen)
621  static int
622  test_crypto(int cfd, struct session_op *sess, int datalen)
623  {
624 -       unsigned char *data;
625 -
626 -       unsigned char mac[AALG_MAX_RESULT_LEN];
627 -
628 -       unsigned char mac_comp[AALG_MAX_RESULT_LEN];
629 +       uint8_t *data;
630 +       uint8_t mac[AALG_MAX_RESULT_LEN];
631 +       uint8_t mac_comp[AALG_MAX_RESULT_LEN];
632  
633         struct crypt_op cryp;
634  
635 diff --git a/tests/hmac.c b/tests/hmac.c
636 index 1d9349e..80a2c42 100644
637 --- a/tests/hmac.c
638 +++ b/tests/hmac.c
639 @@ -69,7 +69,7 @@ test_crypto(int cfd)
640  
641         cryp.ses = sess.ses;
642         cryp.len = sizeof("what do ya want for nothing?")-1;
643 -       cryp.src = "what do ya want for nothing?";
644 +       cryp.src = (uint8_t*)"what do ya want for nothing?";
645         cryp.mac = mac;
646         cryp.op = COP_ENCRYPT;
647         if (ioctl(cfd, CIOCCRYPT, &cryp)) {
648 @@ -113,7 +113,7 @@ test_crypto(int cfd)
649  
650         cryp.ses = sess.ses;
651         cryp.len = sizeof("what do ya want for nothing?")-1;
652 -       cryp.src = "what do ya want for nothing?";
653 +       cryp.src = (uint8_t*)"what do ya want for nothing?";
654         cryp.mac = mac;
655         cryp.op = COP_ENCRYPT;
656         if (ioctl(cfd, CIOCCRYPT, &cryp)) {
657 @@ -246,7 +246,7 @@ test_extras(int cfd)
658  
659         cryp.ses = sess.ses;
660         cryp.len = sizeof("what do")-1;
661 -       cryp.src = "what do";
662 +       cryp.src = (uint8_t*)"what do";
663         cryp.mac = mac;
664         cryp.op = COP_ENCRYPT;
665         cryp.flags = COP_FLAG_UPDATE;
666 @@ -257,7 +257,7 @@ test_extras(int cfd)
667  
668         cryp.ses = sess.ses;
669         cryp.len = sizeof(" ya want for nothing?")-1;
670 -       cryp.src = " ya want for nothing?";
671 +       cryp.src = (uint8_t*)" ya want for nothing?";
672         cryp.mac = mac;
673         cryp.op = COP_ENCRYPT;
674         cryp.flags = COP_FLAG_FINAL;
675 diff --git a/tests/speed.c b/tests/speed.c
676 index d2e1aed..0e2bbc3 100644
677 --- a/tests/speed.c
678 +++ b/tests/speed.c
679 @@ -25,6 +25,7 @@
680  #include <sys/types.h>
681  #include <signal.h>
682  #include <unistd.h>
683 +#include <stdint.h>
684  
685  #include <crypto/cryptodev.h>
686  
687 @@ -75,7 +76,7 @@ int encrypt_data(struct session_op *sess, int fdc, int chunksize, int alignmask)
688  {
689         struct crypt_op cop;
690         char *buffer, iv[32];
691 -       char mac[HASH_MAX_LEN];
692 +       uint8_t mac[HASH_MAX_LEN];
693         static int val = 23;
694         struct timeval start, end;
695         double total = 0;
696 -- 
697 2.10.2
698