How smuellerdd/acvpparser works
Project type and purpose
• This is a standalone, data-driven, command-line JSON parser for the NIST ACVP (Automated Cryptographic Validation Program) protocol.
• It reads pre-downloaded ACVP test vector JSON files, invokes a chosen cryptographic backend to run the tests, and emits response JSON suitable for upload by a separate ACVP Proxy tool.
File structure
Top-level artifacts
• Makefile, backends.mk – orchestrate build and select the active backend (openssl, openssh, leancrypto, protobuf, linux_kernel, etc.).
• README*.md / LICENSE* / CHANGES.md / TODO – documentation and legal.
Three main code areas (layers):
A. Parser Core (folder “parser/”)
– JSON-C library (parser/json-c/) + parser.c + parser_*.c modules (each registers handlers for a specific ACVP test family).
– Implements data-driven parsing: definitions in parser_common.h drive interpretation of input JSON.
B. Protocol Output (“proto/”)
– proto.c, proto_*.c, proto_frontend_app_stdio.c – build the JSON response from the parser’s internal data structures.
C. Backends (folder “backends/” + “backend_interfaces/”)
– backends/backend_*.c – glue code to call each crypto implementation.
– backend_interfaces/ – companion code required for certain backends (e.g. Linux kernel module under kcapi_lrng, Protobuf interface code under protobuf/, OpenSSH interface under openssh/).
Helper scripts
• helper/exec_*.sh – batch and regression test runners.
README for additional insights
• Three-layer architecture is spelled out:
1. parser.c – registration and dispatching based on cipher identifier
2. parser_*.c – JSON parse logic, populating data structures, invoking backends
3. backend_*.c – calls into real crypto implementations (OpenSSL, Kernel, leanCrypto, etc.)
• Build instructions show how backends are selected via make targets.
• Backend-specific hints for kernel, Libreswan, Strongswan, OpenSSH confirm external dependencies.
• Annotations for dynamic registration points (constructor macros), and build-time backend selection (Makefile).
Detail checklist
• CLI entry point and how parser.c registers/dispatches parser modules.
• Actual backend_*.c implementations and external crypto engine or kernel interfaces.
• Helper scripts as an auxiliary component that drives repeated runs.
• Optionally, annotate build-time configuration (Makefile target selects a backend).