less hardcoded sizes and more ARRAYLEN

This commit is contained in:
Philippe Teuwen
2019-07-31 23:44:53 +02:00
parent 74288ad128
commit f276dca3f1
16 changed files with 43 additions and 53 deletions

View File

@@ -20,6 +20,7 @@
#include "../crypto.h"
#include "../dump.h"
#include "util_posix.h"
#include "commonutil.h"
#include <stdlib.h>
#include <string.h>
@@ -312,7 +313,7 @@ int exec_crypto_test(bool verbose) {
}
fprintf(stdout, "Crypto raw test: passed\n\n");
for (i = 0; i < sizeof(keylengths) / sizeof(keylengths[0]); i++) {
for (i = 0; i < ARRAYLEN(keylengths); i++) {
unsigned int kl = keylengths[i];
ret = test_genkey(kl, message, kl / 8, verbose);
if (ret) {