summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2024-02-24 01:42:31 -0500
committerPaul Duncan <pabs@pablotron.org>2024-02-24 01:42:31 -0500
commitec79fdfeb88d863108e6b5cbd161163a60c7fd18 (patch)
treefb299e367d8d8d3678049d6b028314f0e0bcc3ac /tests
parent4f3afe29e01b6d31ee260d171a15b15bbf24a0cd (diff)
downloadsha3-ec79fdfeb88d863108e6b5cbd161163a60c7fd18.tar.bz2
sha3-ec79fdfeb88d863108e6b5cbd161163a60c7fd18.zip
tests/cavp-tests/gen-main.rb: update to reflect shake prototype changes, minor fixes
Diffstat (limited to 'tests')
-rwxr-xr-xtests/cavp-tests/gen-main.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/cavp-tests/gen-main.rb b/tests/cavp-tests/gen-main.rb
index 5d73554..312262e 100755
--- a/tests/cavp-tests/gen-main.rb
+++ b/tests/cavp-tests/gen-main.rb
@@ -123,7 +123,7 @@ SETS = [{
}],
}]
-# header for main.c
+# main.c header
MAIN_HEAD = <<END_MAIN_HEAD
// Run test vectors for FIPS202 hash functions and XOFs.
// (generated by `gen-main.rb`)
@@ -134,6 +134,7 @@ MAIN_HEAD = <<END_MAIN_HEAD
#include "hex.h" // hex_write()
#include "sha3.h"
+// test failure
typedef struct {
const char *test_fn; // test function name
size_t test_i; // test case index
@@ -145,7 +146,7 @@ typedef struct {
size_t exp_len; // expected result length
} failure_t;
-// print failure
+// print failure
static void fail(FILE *fh, const failure_t f) {
fprintf(fh, "test_fn = %s\\n", f.test_fn);
fprintf(fh, "rsp_file = %s\\n", f.rsp_file);
@@ -158,7 +159,7 @@ static void fail(FILE *fh, const failure_t f) {
}
END_MAIN_HEAD
-# template for footer of main.c
+# main.c footer template
MAIN_TAIL_TMPL = <<END_MAIN_TAIL_TMPL
int main(void) {
%<fns>s
@@ -203,7 +204,7 @@ static void test_%<fn>s(void) {
// hash data into "got"
uint8_t got[%<max_exp_len>d] = { 0 };
- %<fn>s_xof_once(DATA + TESTS[i].src_ofs, TESTS[i].src_len, got, exp_len);
+ %<fn>s(DATA + TESTS[i].src_ofs, TESTS[i].src_len, got, exp_len);
// check for expected result
if (memcmp(got, exp, exp_len)) {