-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix up documentation before 3.1 release
Signed-off-by: Steven Bellock <[email protected]>
- Loading branch information
1 parent
ea937ec
commit 3b50fdc
Showing
4 changed files
with
48 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,26 @@ | ||
# AEAD limit | ||
|
||
## document | ||
## Documents | ||
|
||
[RFC 5116](https://www.rfc-editor.org/rfc/rfc5116) defines AEAD algorithm. [IETF AEAD Limits (Draft)](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-aead-limits) describes how to limit the use of keys in order to bound the advantage given to an attacker. | ||
[RFC 5116](https://www.rfc-editor.org/rfc/rfc5116) defines AEAD algorithms. | ||
[IETF AEAD Limits (Draft)](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-aead-limits) | ||
describes how to limit the use of keys in order to bound the advantage given to an attacker. | ||
|
||
NOTE: This is irrelevant to the plaintext bit length limitation (2^39 - 256), which is already defined in [AES-GCM](https://csrc.nist.gov/pubs/sp/800/38/d/final) 5.2.1.1. | ||
NOTE: This is irrelevant to the plaintext bit length limitation (2^39 - 256), which is already | ||
defined in [AES-GCM](https://csrc.nist.gov/pubs/sp/800/38/d/final) 5.2.1.1. | ||
|
||
## sequence number based limitation | ||
## Sequence number based limitation | ||
|
||
[DSP0277](https://www.dmtf.org/dsp/DSP0277) defines 64bit sequence number. The default value is max number 0xFFFFFFFFFFFFFFFFull (64bit). | ||
[DSP0277](https://www.dmtf.org/dsp/DSP0277) defines a 64-bit sequence number. The default value is | ||
the maximum 64-bit value: 0xFFFFFFFFFFFFFFFF. | ||
|
||
The Integrator can set `LIBSPDM_DATA_MAX_SPDM_SESSION_SEQUENCE_NUMBER` to override the default value, such as 0xFFFFFFFF (32bit) or 0xFFFFFF (24bit). | ||
The Integrator can set `LIBSPDM_DATA_MAX_SPDM_SESSION_SEQUENCE_NUMBER` to override the default | ||
value, such as 0xFFFFFFFF (32-bit) or 0xFFFFFF (24-bit). | ||
|
||
The Integrator may get `LIBSPDM_DATA_SESSION_SEQUENCE_NUMBER_REQ_DIR` and `LIBSPDM_DATA_SESSION_SEQUENCE_NUMBER_RSP_DIR` to know the current number of messages that have been encrypted / decrypted in requester and responder direction, and trigger `KEY_UPDATE` flow. | ||
The Integrator may query `LIBSPDM_DATA_SESSION_SEQUENCE_NUMBER_REQ_DIR` and | ||
`LIBSPDM_DATA_SESSION_SEQUENCE_NUMBER_RSP_DIR` to get the current number of messages that have been | ||
encrypted / decrypted in the request and response directions, and trigger may trigger a `KEY_UPDATE` | ||
accordingly. | ||
|
||
If `KEY_UPDATE` is not sent before the max sequence number is reached, the SPDM session will be terminated. | ||
If `KEY_UPDATE` is not sent before the maximum sequence number is reached, the SPDM session will be | ||
terminated. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,30 @@ | ||
# Crypto Endianness | ||
# Cryptography Endianness | ||
|
||
## endianness of digital signature | ||
## Endianness of digital signatures | ||
|
||
SPDM 1.2+ defines the endianness of digital signature for RSA, ECDSA, SM2_DSA, and EdDSA. | ||
SPDM 1.2 and later define the endianness of digital signatures for RSA, ECDSA, SM2_DSA, and EdDSA. | ||
* RSA: big endian for s. | ||
* ECDSA and SMD2_DSA: big endian for r and s. | ||
* EdDSA: big endian for R and little endian for S. | ||
|
||
libspdm follows that for SPDM 1.2+. Because the definition aligns with existing crypto library such as OpenSSL and MbedTLS, no swap is required. | ||
When the negotiated SPDM version is 1.2 or later libspdm follows these definitions. | ||
|
||
SPDM 1.0 and 1.1 do not specify the endianness of the RSA and ECDSA digital signatures. | ||
SPDM 1.0 and 1.1 did not specify the endianness of the RSA and ECDSA digital signatures. libspdm | ||
allows an Integrator to specify the endianness when verifying RSA and ECDSA signatures through | ||
`LIBSPDM_DATA_SPDM_VERSION_10_11_VERIFY_SIGNATURE_ENDIAN` when the negotiated SPDM version is 1.0 or | ||
1.1. | ||
|
||
libspdm uses big endian for RSA and ECDSA for SPDM 1.0/1.1, which algins with SPDM 1.2 and existing crypto library. No swap is required. | ||
## Endianness of key exchange data | ||
|
||
## endianness of key exchange data | ||
|
||
SPDM 1.1+ defines the endianness of key exchange data for FFDHE, ECDHE, and SM2_KeyExchange. | ||
SPDM 1.1 and later defines the endianness of key exchange data for FFDHE, ECDHE, and SM2_KeyExchange. | ||
* FFDHE: big endian for Y. | ||
* ECDHE and SM2_KeyExchange: big endian for X and Y. | ||
|
||
libspdm follows that for SPDM 1.1+. Because the definition aligns with existing crypto library such as openssl and mbedtls, no swap is required. | ||
|
||
## endianness of AEAD IV | ||
|
||
Secured SPDM 1.0/1.1 are not very clear on how to extend 64bit sequence number and XOR with the IV derived from SPDM key schedule. | ||
## Endianness of AEAD IV | ||
|
||
libspdm uses little endian for the sequence number for Secured SPDM 1.0/1.1, which algins with default endianness defined in SPDM 1.0+. No swap is required. | ||
Versions 1.0 and 1.1 of the Secured Messages using SPDM specification do not explicitly specify how | ||
the AEAD IV is formed. In particular the endianness of the sequence number is either missing (1.0) | ||
or ill-defined (1.1). As such libspdm supports both little-endian and big-endian encoding of the | ||
sequence number, as well as automatically swapping endianness if decryption fails. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters