examples/fips_validation: fix string token for CT length
authorAnoob Joseph <anoobj@marvell.com>
Tue, 18 Feb 2020 10:31:12 +0000 (16:01 +0530)
committerDavid Marchand <david.marchand@redhat.com>
Thu, 20 Feb 2020 15:41:49 +0000 (16:41 +0100)
The NIST test vectors use the string 'PTlen' to denote text lengths
in case of encrypt & decrypt operations. So the same string needs to be
used while parsing PT and CT.

Fixes: 2adb3b4e7e54 ("examples/fips_validation: fix AES-GCM cipher length parsing")

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
examples/fips_validation/fips_validation_gcm.c

index bc2d37d..47576e9 100644 (file)
@@ -19,7 +19,6 @@
 #define PTLEN_STR      "PTlen = "
 #define AADLEN_STR     "AADlen = "
 #define TAGLEN_STR     "Taglen = "
-#define CTLEN_STR      "CTlen = "
 
 #define COUNT_STR      "Count = "
 #define KEY_STR                "Key = "
@@ -47,7 +46,10 @@ struct fips_test_callback gcm_interim_vectors[] = {
                {KEYLEN_STR, parser_read_uint32_bit_val, &vec.aead.key},
                {IVLEN_STR, parser_read_uint32_bit_val, &vec.iv},
                {PTLEN_STR, parser_read_uint32_bit_val, &vec.pt},
-               {CTLEN_STR, parser_read_uint32_bit_val, &vec.ct},
+               {PTLEN_STR, parser_read_uint32_bit_val, &vec.ct},
+               /**< The NIST test vectors use 'PTlen' to denote input text
+                *  length in case of decrypt & encrypt operations.
+                */
                {AADLEN_STR, parser_read_uint32_bit_val, &vec.aead.aad},
                {TAGLEN_STR, parser_read_uint32_bit_val,
                                &vec.aead.digest},