aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2019-07-16 21:04:10 -0400
committerPaul Duncan <pabs@pablotron.org>2019-07-16 21:04:10 -0400
commit95629acc2902541460698d1898175499500caecd (patch)
treee5ed5bb6f888617cee6315c8248546fef22197fd /main.c
parentae8484372cbbf0bad041f3bd9b11c18d9cf37be7 (diff)
downloadsha2-95629acc2902541460698d1898175499500caecd.tar.bz2
sha2-95629acc2902541460698d1898175499500caecd.zip
add sha224
Diffstat (limited to 'main.c')
-rw-r--r--main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/main.c b/main.c
index 7c795ef..136a363 100644
--- a/main.c
+++ b/main.c
@@ -19,11 +19,12 @@ static void print_row(
}
static void on_test_fail(
+ const int algo,
const char * const src,
const uint8_t * const got_hash,
const uint8_t * const expected_hash
) {
- printf("\"%s\",", src);
+ printf("sha%d,\"%s\",", algo, src);
print_hash(got_hash);
printf(",");
print_hash(expected_hash);
@@ -61,7 +62,7 @@ int main(int argc, char *argv[]) {
}
} else {
// no command-line parameters given. run internal tests
- printf("input,result,expected\n");
+ printf("algo,input,result,expected\n");
run_tests(on_test_fail);
}