AWS payment-cryptography: Document valid MacLength values per MAC algorithm
Summary
Expands the MacLength parameter description with per-algorithm valid lengths and units (ISO9797, CMAC TDES/AES, AS2805_4_1, DUKPT variants, EmvMac, HMAC).
Security assessment
Documents valid MAC length constraints for cryptographic operations, which is security-relevant parameter guidance for correct MAC generation but does not reference a specific vulnerability or CVE.
Evidence
+ * `CMAC` with an AES key: 8, 16, or 32 hexadecimal characters.
Diff
diff --git a/payment-cryptography/latest/DataAPIReference/API_GenerateMac.md b/payment-cryptography/latest/DataAPIReference/API_GenerateMac.md index b260003..4db9084 100644 --- a//payment-cryptography/latest/DataAPIReference/API_GenerateMac.md +++ b//payment-cryptography/latest/DataAPIReference/API_GenerateMac.md @@ -76 +76,20 @@ Required: Yes -The length of a MAC under generation. +The length of a MAC under generation. The unit and valid values depend on the MAC algorithm: + + * `ISO9797_ALGORITHM1`, `ISO9797_ALGORITHM3`, and `CMAC` with a TDES key: 8 or 16 hexadecimal characters. + + * `CMAC` with an AES key: 8, 16, or 32 hexadecimal characters. + + * `AS2805_4_1`: 8 hexadecimal characters. + + * `DukptCmac`, `DukptIso9797Algorithm1`, and `DukptIso9797Algorithm3`: + + * TDES working key: 8 or 16 hexadecimal characters. + + * AES working key: 8, 16, or 32 hexadecimal characters. + + * `EmvMac`: 4 or 8 bytes. + + * HMAC: this value is currently ignored. The MAC is always the full output of the hash algorithm: 56, 64, 96, or 128 hexadecimal characters for SHA-224, SHA-256, SHA-384, or SHA-512. + + +