examples/fips_validation: update GCM test
authorFan Zhang <roy.fan.zhang@intel.com>
Fri, 9 Oct 2020 20:08:22 +0000 (21:08 +0100)
committerAkhil Goyal <akhil.goyal@nxp.com>
Wed, 14 Oct 2020 20:22:06 +0000 (22:22 +0200)
commitd09abf2d1007be721490b9e5bbd79905d949cd3b
tree60616ceba417e52199f4225fdd93906ab35b5908
parent952e10cdad5e46d66a05e720f773694ffb558bc0
examples/fips_validation: update GCM test

This patch updates fips validation GCM test capabilities:

- In NIST GCMVS spec GMAC test vectors are the GCM ones with
plaintext length as 0 and uses AAD as input data. Originally
fips_validation tests treats them both as GCM test vectors.
This patch introduce automatic test type recognition between
the two: when plaintext length is 0 the prepare_gmac_xform
and prepare_auth_op functions are called, otherwise
prepare_gcm_xform and prepare_aead_op functions are called.

- NIST GCMVS also specified externally or internally IV
generation. When IV is to be generated by IUT internally IUT
shall store the generated IV in the response file. This patch
also adds the support to that.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Signed-off-by: Weqaar Janjua <weqaar.a.janjua@intel.com>
Acked-by: John Griffin <john.griffin@intel.com>
doc/guides/rel_notes/release_20_11.rst
examples/fips_validation/fips_validation.h
examples/fips_validation/fips_validation_gcm.c
examples/fips_validation/main.c