Skip to content

Commit 03437a1

Browse files
committed
timing - silence valgrind warning
1 parent 8dec4d9 commit 03437a1

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

demos/timing.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ static void time_cipher_ecb(void)
173173
unsigned long x, y1;
174174
ulong64 t1, t2, c1, c2, a1, a2;
175175
symmetric_ECB ecb;
176-
unsigned char key[MAXBLOCKSIZE], pt[4096];
176+
unsigned char key[MAXBLOCKSIZE] = { 0 }, pt[4096] = { 0 };
177177
int err;
178178

179179
fprintf(stderr, "\n\nECB Time Trials for the Symmetric Ciphers:\n");
@@ -246,7 +246,7 @@ static void time_cipher_cbc(void)
246246
unsigned long x, y1;
247247
ulong64 t1, t2, c1, c2, a1, a2;
248248
symmetric_CBC cbc;
249-
unsigned char key[MAXBLOCKSIZE], pt[4096];
249+
unsigned char key[MAXBLOCKSIZE] = { 0 }, pt[4096] = { 0 };
250250
int err;
251251

252252
fprintf(stderr, "\n\nCBC Time Trials for the Symmetric Ciphers:\n");
@@ -319,7 +319,7 @@ static void time_cipher_ctr(void)
319319
unsigned long x, y1;
320320
ulong64 t1, t2, c1, c2, a1, a2;
321321
symmetric_CTR ctr;
322-
unsigned char key[MAXBLOCKSIZE], pt[4096];
322+
unsigned char key[MAXBLOCKSIZE] = { 0 }, pt[4096] = { 0 };
323323
int err;
324324

325325
fprintf(stderr, "\n\nCTR Time Trials for the Symmetric Ciphers:\n");
@@ -392,7 +392,7 @@ static void time_cipher_lrw(void)
392392
unsigned long x, y1;
393393
ulong64 t1, t2, c1, c2, a1, a2;
394394
symmetric_LRW lrw;
395-
unsigned char key[MAXBLOCKSIZE], pt[4096];
395+
unsigned char key[MAXBLOCKSIZE] = { 0 }, pt[4096] = { 0 };
396396
int err;
397397

398398
fprintf(stderr, "\n\nLRW Time Trials for the Symmetric Ciphers:\n");
@@ -468,7 +468,7 @@ static void time_hash(void)
468468
ulong64 t1, t2, c1, c2;
469469
hash_state md;
470470
int (*func)(hash_state *, const unsigned char *, unsigned long), err;
471-
unsigned char pt[MAXBLOCKSIZE];
471+
unsigned char pt[MAXBLOCKSIZE] = { 0 };
472472

473473

474474
fprintf(stderr, "\n\nHASH Time Trials for:\n");
@@ -688,7 +688,7 @@ static void time_rsa(void)
688688
{
689689
rsa_key key;
690690
ulong64 t1, t2;
691-
unsigned char buf[2][2048];
691+
unsigned char buf[2][2048] = { 0 };
692692
unsigned long x, y, z, zzz;
693693
int err, zz, stat;
694694

@@ -934,7 +934,7 @@ static void time_ecc(void)
934934
{
935935
ecc_key key;
936936
ulong64 t1, t2;
937-
unsigned char buf[2][256];
937+
unsigned char buf[2][256] = { 0 };
938938
unsigned long i, w, x, y, z;
939939
int err, stat;
940940
static unsigned long sizes[] = {

0 commit comments

Comments
 (0)