Skip to content

Commit

Permalink
tests: [ACVP] support libacvp 2.2.0
Browse files Browse the repository at this point in the history
The new libacvp version 2.2.0 supports offline vector parsing.

Signed-off-by: Pablo de Lara <[email protected]>
  • Loading branch information
pablodelara authored and mdcornu committed Nov 6, 2024
1 parent 2188e8a commit d3a248d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/acvp/acvp_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@
#include <acvp/acvp.h>
#include "include/isal_crypto_api.h"

#define LIB_VER(a, b, c) (((a) << 16) + ((b) << 8) + (c))

/* Available from libacvp 2.1.0 */
#ifdef ACVP_LIBRARY_VERSION_MAJOR
#define INT_ACVP_LIB_VER_NUM \
LIB_VER(ACVP_LIBRARY_VERSION_MAJOR, ACVP_LIBRARY_VERSION_MINOR, ACVP_LIBRARY_VERSION_PATCH)
#else
/* Assume version 2.0.0 (minimum required for this app) */
#define INT_ACVP_LIB_VER_NUM LIB_VER(2, 0, 0)
#endif

#if defined(__GNUC__) || defined(__clang__)
#define ATTRIBUTE(x) __attribute__((x))
#else
Expand Down Expand Up @@ -167,7 +178,11 @@ main(int argc, char **argv)

// Parse request file, run crypto tests and write out response file
if (req_filename != NULL && rsp_filename != NULL) {
#if INT_ACVP_LIB_VER_NUM >= LIB_VER(2, 2, 0)
ret = acvp_run_vectors_from_file_offline(ctx, req_filename, rsp_filename);
#else
ret = acvp_run_vectors_from_file(ctx, req_filename, rsp_filename);
#endif
goto exit;
}
// Run the test session from server
Expand Down

0 comments on commit d3a248d

Please sign in to comment.