Background
The Cryptography Group decided to go for the "short form" of describing the operationMode parameter first, and later on, based on community request, evaluate the possibility to add the "extended form" of describing the operationMode on any specific algorithm.
The "extended form" is already described in a proposal so a significant part of the required work to add this more detailed way to describe the operationMode of any specific algorithm is already done.
Rationale
The Cryptography Group is not sure about the need for the "extended form" in the List. If there is any use case that justifies it, then it should be considered. For now, #80 and #81 describe the needs at this point.
Description
In addition to the current way to describe the operationMode of an algorithm, there is a second way we have identified and described. We call that additional way to describe the operationMode "extended form", vs the current way which is called "short form".
This is the way we would introduce the "extended form" into the docs/crypto-algorithms-list-properties-parameters-description.md
`### parameterName
- Description: The set of valid values depends on the algorithm's cryptoClass / cryptoSubClass. Each parameter have a different structure so their description is specific to each one of them
- Cardinality: [0..*]
- Values:
- Enumeration: "operationMode", "padding", "paddingScheme", "digestFunction", "variant", "construction", "pseudorandomFunction", "group", "curve", "pointCompression", "polynomial", "underlyingCipher"
- Numeric: "nonceLength", "ivLength", "tagLength", "keyLength", "outputLength", "saltLength", "modulusLength", "pPrimeLength", "qPrimeLength", "publicExponent", "iterations", "memoryCost", "parallelism", "costFactor", "rounds", "dropBytes"
operationMode
- Description: the mode of operation under which a block cipher is applied to data. Modes are standardised constructions that compose the cipher's primitive transformation into a complete encryption scheme over arbitrary-length input.
- GCM: Galois/Counter Mode
- CCM: Counter with CBC-MAC
- CBC: Cipher Block Chaining
- CTR: Counter Mode
- OFB: Output Feedback Mode
- CFB: Cipher Feedback Mode
- XTS: XEX-based Tweaked Cipher Mode with ciphertext stealing
- SIV: Synthetic Initialization Vector
- GCM-SIV: GCM with Synthetic IV
- EAX: Encrypt-then-Authenticate-then-Translate Mode
- OCB: Offset Codebook Mode
- CTS: Ciphertext Stealing
- CWC: Carter-Wegman Counter Mode
- IAPM: Integrity-Aware Parallelizable Mode
- LRW: Liskov-Rivest-Wagner Mode
- XEX: XOR-Encrypt-XOR Mode
- CMC: CBC-Mask-CBC Mode
- EME: Encrypt-Mix-Encrypt Mode
- HCTR2: Length-Preserving Encryption with HCTR2
- CMAC: Cipher-based MAC
- GMAC: Galois MAC
- PMAC: Parallelizable MAC
- PCBC: Propagating CBC
- IGE: Infinite Garble Extension
- ECB: Electronic Codebook
- FF1: Format-Preserving Encryption method 1
- FF3: Format-Preserving Encryption method 3 (original)
- FF3-1: Format-Preserving Encryption method 3, revised
- Wrap: Key Wrap
- XCBC_MAC: XCBC Message Authentication Code (Black, Rogaway, CRYPTO 2000)
- Applicability: determines which security service the construction provides (confidentiality only, authenticated encryption, AEAD, or key wrapping) and what auxiliary inputs the scheme requires (initialisation vector, nonce, authentication tag, padding). A given mode is only meaningful for a block cipher of a compatible block size.
- Cardinality: [1..*]
- Values: "GCM", "CCM", "CBC", "CTR", "OFB", "CFB", "CFB1", "CFB8", "CFB128", "XTS", "SIV", "GCM-SIV", "EAX", "OCB", "OCB2", "OCB3", "CTS", "CBC-CS1", "CBC-CS2", "CBC-CS3", "CWC", "IAPM", "LRW", "XEX", "CMC", "EME", "HCTR2", "CMAC", "GMAC", "PMAC", "PCBC", "IGE", "ECB", "FF1", "FF3", "FF3-1", "Wrap", "KW", "KWP", "TKW", "XCBC_MAC", "XCBC_MAC_96"
Qualifiers (extended form)
An algorithm entry can describe operationMode in two ways.
- Short form: only the operationMode value is given, using one of the values listed above. This states which mode applies, with no further detail.
- Extended form: the operationMode value is given together with one or more qualifiers. The qualifiers add the length or scheme detail that applies to that specific algorithm and mode, such as the nonce length, the IV length, the tag length, or the padding scheme in use.
The extended form is used when the group wants to record the exact configuration used with a mode, not only the mode name. Each qualifier is described below.
The extended form is a list. Each list item is a mapping that starts with its own operationMode key, plus whichever qualifiers apply to that specific mode. A plain YAML mapping cannot repeat the same key twice at the same level, so each mode's qualifiers must live inside its own list item rather than all being written flat under a single shared operationMode: key.
operationMode:
- operationMode: 'GCM'
nonceLength: '96'
tagLength: '128'
- operationMode: 'CBC'
padding: 'PKCS7'
- operationMode: 'CTR'
Modes with no qualifiers (like CTR above) are listed with just their operationMode key and nothing else.
nonceLength
- Description: nonce length
- Cardinality: [0..1]
- Values: one of these options, or a combination of them, are valid
- '', where is an integer, provided in bits, as a quoted string.
- ['','', ... ''], where , , ... are different integers, provided in bits, and in ascendant order.
- {min: '', max: ''}, where is the minimum integer, and is the maximum integer of the range, both provided in bits.
ivLength
- Description: initialization vector length
- Cardinality: [0..1]
- Values: one of these options, or a combination of them, are valid
- '', where is an integer, provided in bits, as a quoted string.
- ['','', ... ''], where , , ... are different integers, provided in bits, and in ascendant order.
- {min: '', max: ''}, where is the minimum integer, and is the maximum integer of the range, both provided in bits.
tagLength
- Description: authentication tag length
- Cardinality: [0..1]
- Values: one of these options, or a combination of them, are valid
- '', where is an integer, provided in bits, as a quoted string.
- ['','', ... ''], where , , ... are different integers, provided in bits, and in ascendant order.
- {min: '', max: ''}, where is the minimum integer, and is the maximum integer of the range, both provided in bits.
padding
- Description: the padding scheme used to handle a plaintext length that is not a multiple of the block size, for block-cipher modes such as CBC. This is distinct from
paddingScheme, which applies to public-key primitives (e.g. RSA-OAEP, RSA-PSS) and covers a different, non-overlapping set of values.
- Cardinality: [0..1]
- Values: a single string (padding scheme id), or an array of strings if more than one padding scheme is valid for that mode entry`
Examples of algorithms described through this "extended form" are
# rc5.yaml (extended form, when the padded variant needs to be distinguished) parameters: operationMode: - operationMode: 'ECB' - operationMode: 'CBC' padding: 'PKCS5' - operationMode: 'CTS' keyLength: {min: '0', max: '2040'}
and
parameters: operationMode: - operationMode: 'GCM' nonceLength: '96' tagLength: '128' - operationMode: 'CBC' padding: 'PKCS7' - operationMode: 'CTR'
Actions
DoD
- Link to the MoM where the Cryptography Group decides to incorporate the "extended form"
- Link to the proposal
- Link to PRs
- Link to the approved description and affected algorithms
Background
The Cryptography Group decided to go for the "short form" of describing the operationMode parameter first, and later on, based on community request, evaluate the possibility to add the "extended form" of describing the operationMode on any specific algorithm.
The "extended form" is already described in a proposal so a significant part of the required work to add this more detailed way to describe the operationMode of any specific algorithm is already done.
Rationale
The Cryptography Group is not sure about the need for the "extended form" in the List. If there is any use case that justifies it, then it should be considered. For now, #80 and #81 describe the needs at this point.
Description
In addition to the current way to describe the operationMode of an algorithm, there is a second way we have identified and described. We call that additional way to describe the operationMode "extended form", vs the current way which is called "short form".
This is the way we would introduce the "extended form" into the docs/crypto-algorithms-list-properties-parameters-description.md
`### parameterName
operationMode
Qualifiers (extended form)
An algorithm entry can describe operationMode in two ways.
The extended form is used when the group wants to record the exact configuration used with a mode, not only the mode name. Each qualifier is described below.
The extended form is a list. Each list item is a mapping that starts with its own
operationModekey, plus whichever qualifiers apply to that specific mode. A plain YAML mapping cannot repeat the same key twice at the same level, so each mode's qualifiers must live inside its own list item rather than all being written flat under a single sharedoperationMode:key.Modes with no qualifiers (like
CTRabove) are listed with just theiroperationModekey and nothing else.nonceLength
ivLength
tagLength
padding
paddingScheme, which applies to public-key primitives (e.g. RSA-OAEP, RSA-PSS) and covers a different, non-overlapping set of values.Examples of algorithms described through this "extended form" are
# rc5.yaml (extended form, when the padded variant needs to be distinguished) parameters: operationMode: - operationMode: 'ECB' - operationMode: 'CBC' padding: 'PKCS5' - operationMode: 'CTS' keyLength: {min: '0', max: '2040'}and
parameters: operationMode: - operationMode: 'GCM' nonceLength: '96' tagLength: '128' - operationMode: 'CBC' padding: 'PKCS7' - operationMode: 'CTR'Actions
DoD