Skip to content

Commit

Permalink
Merge pull request #1559 from usnistgov/gh1543-update-cmac-aes-tdes-a…
Browse files Browse the repository at this point in the history
…es-gmac-vector-data

closes #1543
  • Loading branch information
livebe01 authored Feb 21, 2025
2 parents 6c7086c + 6bfd3c5 commit 28f6b68
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/mac/sections/05-gmac-capabilities.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ The following is an example JSON object advertising support for AES-GMAC.
120
],
"ivGen": "external",
"ivGenMode": "8.2.2",
"aadLen": [
8,
120
Expand Down
2 changes: 1 addition & 1 deletion src/mac/sections/06-cmac-aes-test-vectors.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Each test group contains an array of one or more test cases. Each test case is a

| tcId | Numeric identifier for the test case, unique across the entire vector set | integer
| key | Encryption key to use | hex
| msg | Value of the message | hex
| message | Value of the message | hex
| mac | MAC value, for CMAC verify | hex
|===

Expand Down
8 changes: 3 additions & 5 deletions src/mac/sections/06-cmac-tdes-test-vectors.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ The testGroups element at the top level in the test vector JSON object is an arr
| tgId | Numeric identifier for the test group, unique across the entire vector set | integer
| testType | Test category type | string
| direction | The direction of the tests - gen or ver | string
| keyLen | Length of key in bits to use | integer
| msgLen | Length of message in bits | integer
| macLen | Length of MAC in bits to generate/verify | integer
| keyingOption | The Keying Option used in TDES. Keying option 1 (1) is 3 distinct keys (K1, K2, K3). Keying Option 2 (2) is 2 distinct only suitable for decrypt (K1, K2, K1). Keying option 3 (No longer valid for testing, save TDES KATs) is a single key, now deprecated (K1, K1, K1). | array | 1, 2
| tests | Array of individual test vector JSON objects, which are defined in <<cmac_tdes_tvjs>> | array
|===

Expand All @@ -31,9 +31,9 @@ Each test group contains an array of one or more test cases. Each test case is a
| JSON Value | Description | JSON type

| tcId | Numeric identifier for the test case, unique across the entire vector set | integer
| key1, key2, key3 | Encryption keys to use for TDES | hex
| msg | Value of the message | hex
| message | Value of the message | hex
| mac | MAC value, for CMAC verify | hex
| key1, key2, key3 | Encryption keys to use for TDES | hex
|===

[[cmac_tdes_test_vector_json]]
Expand All @@ -51,7 +51,6 @@ The following is an example JSON test vector object for CMAC-TDES, truncated for
"tgId": 4,
"testType": "AFT",
"direction": "gen",
"keyLen": 192,
"msgLen": 752,
"macLen": 32,
"keyingOption": 1,
Expand Down Expand Up @@ -82,7 +81,6 @@ The following is an example JSON test vector object for CMAC-TDES, truncated for
"tgId": 10,
"testType": "AFT",
"direction": "ver",
"keyLen": 192,
"msgLen": 0,
"macLen": 32,
"keyingOption": 1,
Expand Down
4 changes: 4 additions & 0 deletions src/mac/sections/06-gmac-test-vectors.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ The testGroups element at the top level in the test vector JSON object is an arr
| tests | Array of individual test vector JSON objects, which are defined in <<gmac_tcjs>> | array
|===

| NOTE: PayloadLength is not supported for GMAC which defaults to 0, and is printed to the Test Group for clarity.

[[gmac_tcjs]]
==== AES-GMAC Test Case JSON Schema

Expand Down Expand Up @@ -60,6 +62,7 @@ The following is an example JSON test vector object for AES-GMAC, truncated for
"keyLen": 128,
"ivLen": 96,
"ivGen": "external",
ivGenMode": "8.2.2",
"aadLen": 0,
"tagLen": 32,
"tests": [{
Expand All @@ -76,6 +79,7 @@ The following is an example JSON test vector object for AES-GMAC, truncated for
"keyLen": 128,
"ivLen": 96,
"ivGen": "external",
ivGenMode": "8.2.2",
"aadLen": 0,
"tagLen": 32,
"tests": [{
Expand Down

0 comments on commit 28f6b68

Please sign in to comment.