Skip to content

Commit 24e69b2

Browse files
committed
more printf() clean-up
* remove last occurences in non-test code * minimize in tests
1 parent 8b7edf5 commit 24e69b2

File tree

6 files changed

+6
-28
lines changed

6 files changed

+6
-28
lines changed

src/encauth/eax/eax_test.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,7 @@ int eax_test(void)
242242
}
243243
if ((res != 1) || compare_testvector(outct, tests[x].msglen, tests[x].plaintext, tests[x].msglen, "EAX", x)) {
244244
#ifdef LTC_TEST_DBG
245-
printf("\n\nEAX: Failure-decrypt\n");
246-
printf("\nres = %d\n\n", res);
245+
printf("\n\nEAX: Failure-decrypt - res = %d\n", res);
247246
#endif
248247
return CRYPT_FAIL_TESTVECTOR;
249248
}

src/encauth/ocb/ocb_test.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,7 @@ int ocb_test(void)
191191
}
192192
if ((res != 1) || compare_testvector(outct, tests[x].ptlen, tests[x].pt, tests[x].ptlen, "OCB", x)) {
193193
#ifdef LTC_TEST_DBG
194-
printf("\n\nOCB: Failure-decrypt\n");
195-
printf("\nres = %d\n\n", res);
194+
printf("\n\nOCB: Failure-decrypt - res = %d\n", res);
196195
#endif
197196
return CRYPT_FAIL_TESTVECTOR;
198197
}

src/encauth/ocb3/ocb3_test.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,7 @@ int ocb3_test(void)
201201
}
202202
if ((res != 1) || compare_testvector(outct, tests[x].ptlen, tests[x].pt, tests[x].ptlen, "OCB3", x)) {
203203
#ifdef LTC_TEST_DBG
204-
printf("\n\nOCB3: Failure-decrypt\n");
205-
printf("\nres = %d\n\n", res);
204+
printf("\n\nOCB3: Failure-decrypt - res = %d\n", res);
206205
#endif
207206
return CRYPT_FAIL_TESTVECTOR;
208207
}

src/misc/hkdf/hkdf.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -128,18 +128,6 @@ int hkdf(int hash_idx, const unsigned char *salt, unsigned long saltlen,
128128
XFREE(extracted);
129129
return err;
130130
}
131-
#if 0
132-
{
133-
int j;
134-
printf("\nPRK: 0x");
135-
for(j=0; j < hashsize; j++) {
136-
printf("%02x ", extracted[j]);
137-
}
138-
for(j=0; j < hashsize; j++) {
139-
printf("%02x ", extracted[j]);
140-
}
141-
}
142-
#endif
143131
err = hkdf_expand(hash_idx, info, infolen, extracted, hashsize, out, outlen);
144132
zeromem(extracted, hashsize);
145133
XFREE(extracted);

src/misc/hkdf/hkdf_test.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,6 @@ int hkdf_test(void)
273273

274274
if(compare_testvector(OKM, cases[i].OKM_l, cases[i].OKM, (size_t)cases[i].OKM_l, "HKDF", cases[i].num)) {
275275
failed++;
276-
#if LTC_TEST_DBG > 1
277-
} else {
278-
printf("LTC_HKDF-%s test #%d: Passed\n", cases[i].Hash, cases[i].num);
279-
#endif
280276
}
281277
}
282278

src/misc/pkcs5/pkcs_5_test.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,7 @@ int pkcs_5_test (void)
176176
cases_5_2[i].c, hash,
177177
DK, &dkLen)) != CRYPT_OK) {
178178
#ifdef LTC_TEST_DBG
179-
printf("\nPKCS#5_2 test #%d: Failed/1\n", i);
180-
printf("err=%d\n", err);
179+
printf("\npkcs_5_alg2() #%d: Failed/1 (%s)\n", i, error_to_string(err));
181180
#endif
182181
++failed;
183182
}
@@ -194,8 +193,7 @@ int pkcs_5_test (void)
194193
cases_5_1[i].c, hash,
195194
DK, &dkLen)) != CRYPT_OK) {
196195
#ifdef LTC_TEST_DBG
197-
printf("\nPKCS#5_1 test #%d: Failed/1\n", i);
198-
printf("err=%d\n", err);
196+
printf("\npkcs_5_alg1() #%d: Failed/1 (%s)\n", i, error_to_string(err));
199197
#endif
200198
++failed;
201199
}
@@ -212,8 +210,7 @@ int pkcs_5_test (void)
212210
cases_5_1o[i].c, hash,
213211
DK, &dkLen)) != CRYPT_OK) {
214212
#ifdef LTC_TEST_DBG
215-
printf("\nPKCS#5_1o test #%d: Failed/1\n", i);
216-
printf("err=%d\n", err);
213+
printf("\npkcs_5_alg1_openssl() #%d: Failed/1 (%s)\n", i, error_to_string(err));
217214
#endif
218215
++failed;
219216
}

0 commit comments

Comments
 (0)