From bbac77bc744d7e4314c1fa61e2ccd37ad4a51dcf Mon Sep 17 00:00:00 2001 From: achamayou Date: Sun, 8 Nov 2026 17:08:15 +0000 Subject: [PATCH] Align with RFC 9864 (fully-specified algorithms) draft-ietf-jose-fully-specified-algorithms-13 was published as RFC 9864. Code points are unchanged; update references, register Ed25519/Ed448 as JOSE algorithms, mark EdDSA/ES256/ES384/ES512 as deprecated in docs, and use Ed25519 instead of EdDSA in README examples and their mirrored tests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- CHANGES.rst | 4 +++ README.md | 44 +++++++++++++-------------- cwt/const.py | 16 +++++----- docs/algorithms.rst | 14 +++++---- tests/test_cose_sample_with_encode.py | 42 ++++++++++++------------- 5 files changed, 64 insertions(+), 56 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 935d3619..49fc7289 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -10,6 +10,10 @@ Unreleased - ``CWT.decode()`` now checks the CWT Claims header parameter in unprotected headers and in every COSE layer of a nested CWT, not only in the protected header of the innermost layer. - ``CWT.decode()`` now requires header and payload claim values to be identical CBOR data items (e.g. ``1``, ``1.0`` and ``True`` no longer compare equal), as RFC 9597 requires. - ``CWT.decode()`` now raises ``ValueError`` if the CWT Claims header parameter is not a map or occurs in both the protected and unprotected headers. +- Follow RFC 9864 (Fully-Specified Algorithms for JOSE and COSE), formerly draft-ietf-jose-fully-specified-algorithms-13. + - Add Ed25519 and Ed448 to supported JOSE algorithms. + - Mark EdDSA, ES256, ES384 and ES512 as deprecated in docs. + - Use Ed25519 instead of EdDSA in README examples. Version 3.3.0 ------------- diff --git a/README.md b/README.md index 6aaabc57..042c8459 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ implementation compliant with: - [RFC8392: CWT (CBOR Web Token)](https://tools.ietf.org/html/rfc8392) - [RFC9597: CBOR Web Token (CWT) Claims in COSE Headers](https://www.rfc-editor.org/rfc/rfc9597.html) - [draft-23: Use of HPKE with COSE](https://www.ietf.org/archive/id/draft-ietf-cose-hpke-23.html) - experimental -- [draft-13: Fully-Specified Algorithms for JOSE and COSE](https://www.ietf.org/archive/id/draft-ietf-jose-fully-specified-algorithms-13.html) +- [RFC9864: Fully-Specified Algorithms for JSON Object Signing and Encryption (JOSE) and CBOR Object Signing and Encryption (COSE)](https://www.rfc-editor.org/rfc/rfc9864.html) - and related various specifications. See [Referenced Specifications](#referenced-specifications). It is designed to make users who already know about [JWS](https://tools.ietf.org/html/rfc7515)/[JWE](https://tools.ietf.org/html/rfc7516)/[JWT](https://tools.ietf.org/html/rfc7519) @@ -254,7 +254,7 @@ notary = Signer.from_jwk( "kid": "01", "kty": "OKP", "crv": "Ed25519", - "alg": "EdDSA", + "alg": "Ed25519", "x": "2E6dX83gqD_D0eAmqnaHe1TC1xuld6iAKXfw2OVATr0", "d": "L8JS08VsFZoZxGa9JvzYmCWOwg7zaKcei3KZmYsj7dc", }, @@ -267,7 +267,7 @@ pub_key = COSEKey.from_jwk( "kid": "01", "kty": "OKP", "crv": "Ed25519", - "alg": "EdDSA", + "alg": "Ed25519", "x": "2E6dX83gqD_D0eAmqnaHe1TC1xuld6iAKXfw2OVATr0", }, ) @@ -278,7 +278,7 @@ try: except Exception as err: pytest.fail(f"failed to verify: {err}") countersignature = COSEMessage.from_cose_signature(sig) -assert countersignature.protected[1] == -8 # alg: "EdDSA" +assert countersignature.protected[1] == -19 # alg: "Ed25519" assert countersignature.unprotected[4] == b"01" # kid: b"01" ``` @@ -491,7 +491,7 @@ notary = Signer.from_jwk( "kid": "01", "kty": "OKP", "crv": "Ed25519", - "alg": "EdDSA", + "alg": "Ed25519", "x": "2E6dX83gqD_D0eAmqnaHe1TC1xuld6iAKXfw2OVATr0", "d": "L8JS08VsFZoZxGa9JvzYmCWOwg7zaKcei3KZmYsj7dc", }, @@ -504,7 +504,7 @@ pub_key = COSEKey.from_jwk( "kid": "01", "kty": "OKP", "crv": "Ed25519", - "alg": "EdDSA", + "alg": "Ed25519", "x": "2E6dX83gqD_D0eAmqnaHe1TC1xuld6iAKXfw2OVATr0", }, ) @@ -515,7 +515,7 @@ try: except Exception as err: pytest.fail(f"failed to verify: {err}") countersignature = COSEMessage.from_cose_signature(sig) -assert countersignature.protected[1] == -8 # alg: "EdDSA" +assert countersignature.protected[1] == -19 # alg: "Ed25519" assert countersignature.unprotected[4] == b"01" # kid: b"01" ``` @@ -637,7 +637,7 @@ notary = Signer.from_jwk( "kid": "01", "kty": "OKP", "crv": "Ed25519", - "alg": "EdDSA", + "alg": "Ed25519", "x": "2E6dX83gqD_D0eAmqnaHe1TC1xuld6iAKXfw2OVATr0", "d": "L8JS08VsFZoZxGa9JvzYmCWOwg7zaKcei3KZmYsj7dc", }, @@ -650,7 +650,7 @@ pub_key = COSEKey.from_jwk( "kid": "01", "kty": "OKP", "crv": "Ed25519", - "alg": "EdDSA", + "alg": "Ed25519", "x": "2E6dX83gqD_D0eAmqnaHe1TC1xuld6iAKXfw2OVATr0", }, ) @@ -661,7 +661,7 @@ try: except Exception as err: pytest.fail(f"failed to verify: {err}") countersignature = COSEMessage.from_cose_signature(sig) -assert countersignature.protected[1] == -8 # alg: "EdDSA" +assert countersignature.protected[1] == -19 # alg: "Ed25519" assert countersignature.unprotected[4] == b"01" # kid: b"01" ``` @@ -990,7 +990,7 @@ notary = Signer.from_jwk( "kid": "01", "kty": "OKP", "crv": "Ed25519", - "alg": "EdDSA", + "alg": "Ed25519", "x": "2E6dX83gqD_D0eAmqnaHe1TC1xuld6iAKXfw2OVATr0", "d": "L8JS08VsFZoZxGa9JvzYmCWOwg7zaKcei3KZmYsj7dc", }, @@ -1003,7 +1003,7 @@ pub_key = COSEKey.from_jwk( "kid": "01", "kty": "OKP", "crv": "Ed25519", - "alg": "EdDSA", + "alg": "Ed25519", "x": "2E6dX83gqD_D0eAmqnaHe1TC1xuld6iAKXfw2OVATr0", }, ) @@ -1015,7 +1015,7 @@ try: except Exception as err: pytest.fail(f"failed to verify: {err}") countersignature = COSEMessage.from_cose_signature(sig) -assert countersignature.protected[1] == -8 # alg: "EdDSA" +assert countersignature.protected[1] == -19 # alg: "Ed25519" assert countersignature.unprotected[4] == b"01" # kid: b"01" ``` @@ -1139,7 +1139,7 @@ notary = Signer.from_jwk( "kid": "01", "kty": "OKP", "crv": "Ed25519", - "alg": "EdDSA", + "alg": "Ed25519", "x": "2E6dX83gqD_D0eAmqnaHe1TC1xuld6iAKXfw2OVATr0", "d": "L8JS08VsFZoZxGa9JvzYmCWOwg7zaKcei3KZmYsj7dc", }, @@ -1161,7 +1161,7 @@ notary_pub_key = COSEKey.from_jwk( "kid": "01", "kty": "OKP", "crv": "Ed25519", - "alg": "EdDSA", + "alg": "Ed25519", "x": "2E6dX83gqD_D0eAmqnaHe1TC1xuld6iAKXfw2OVATr0", }, ) @@ -1172,7 +1172,7 @@ try: except Exception as err: pytest.fail(f"failed to verify: {err}") countersignature = COSEMessage.from_cose_signature(sig) -assert countersignature.protected[1] == -8 # alg: "EdDSA" +assert countersignature.protected[1] == -19 # alg: "Ed25519" assert countersignature.unprotected[4] == b"01" # kid: b"01" ``` @@ -1242,7 +1242,7 @@ notary = Signer.from_jwk( "kid": "01", "kty": "OKP", "crv": "Ed25519", - "alg": "EdDSA", + "alg": "Ed25519", "x": "2E6dX83gqD_D0eAmqnaHe1TC1xuld6iAKXfw2OVATr0", "d": "L8JS08VsFZoZxGa9JvzYmCWOwg7zaKcei3KZmYsj7dc", }, @@ -1264,7 +1264,7 @@ notary_pub_key = COSEKey.from_jwk( "kid": "01", "kty": "OKP", "crv": "Ed25519", - "alg": "EdDSA", + "alg": "Ed25519", "x": "2E6dX83gqD_D0eAmqnaHe1TC1xuld6iAKXfw2OVATr0", }, ) @@ -1276,7 +1276,7 @@ try: except Exception as err: pytest.fail(f"failed to verify: {err}") countersignature = COSEMessage.from_cose_signature(sig) -assert countersignature.protected[1] == -8 # alg: "EdDSA" +assert countersignature.protected[1] == -19 # alg: "Ed25519" assert countersignature.unprotected[4] == b"01" # kid: b"01" ``` @@ -1384,7 +1384,7 @@ private_key = COSEKey.from_jwk( "kid": "01", "kty": "OKP", "key_ops": ["sign"], - "alg": "EdDSA", + "alg": "Ed25519", "crv": "Ed25519", "x": "2E6dX83gqD_D0eAmqnaHe1TC1xuld6iAKXfw2OVATr0", "d": "L8JS08VsFZoZxGa9JvzYmCWOwg7zaKcei3KZmYsj7dc", @@ -1646,7 +1646,7 @@ token = cwt.encode( "crv": "Ed25519", "kid": "presenter-01", "x": "2E6dX83gqD_D0eAmqnaHe1TC1xuld6iAKXfw2OVATr0", - "alg": "EdDSA", + "alg": "Ed25519", }, }, }, @@ -1822,7 +1822,7 @@ Python CWT is (partially) compliant with following specifications: - [RFC9597: CBOR Web Token (CWT) Claims in COSE Headers](https://www.rfc-editor.org/rfc/rfc9597.html) - [RFC8152: CBOR Object Signing and Encryption (COSE)](https://tools.ietf.org/html/rfc8152) - [draft-23: Use of HPKE with COSE](https://www.ietf.org/archive/id/draft-ietf-cose-hpke-23.html) - experimental -- [draft-13: Fully-Specified Algorithms for JOSE and COSE](https://www.ietf.org/archive/id/draft-ietf-jose-fully-specified-algorithms-13.html) +- [RFC9864: Fully-Specified Algorithms for JSON Object Signing and Encryption (JOSE) and CBOR Object Signing and Encryption (COSE)](https://www.rfc-editor.org/rfc/rfc9864.html) - [Electronic Health Certificate Specification](https://github.com/ehn-dcc-development/hcert-spec/blob/main/hcert_spec.md) - [Technical Specifications for Digital Green Certificates Volume 1](https://ec.europa.eu/health/sites/default/files/ehealth/docs/digital-green-certificates_v1_en.pdf) diff --git a/cwt/const.py b/cwt/const.py index 6ca5de31..2652da90 100644 --- a/cwt/const.py +++ b/cwt/const.py @@ -270,9 +270,9 @@ # COSE Algorithms for Signature with OKP. COSE_ALGORITHMS_SIG_OKP = { - "EdDSA": -8, # EdDSA - "Ed25519": -19, # EdDSA using Ed25519 curve - "Ed448": -53, # EdDSA using Ed448 curve + "EdDSA": -8, # EdDSA (Deprecated by RFC 9864) + "Ed25519": -19, # EdDSA using the Ed25519 parameter set in Section 5.1 of RFC 8032 + "Ed448": -53, # EdDSA using the Ed448 parameter set in Section 5.2 of RFC 8032 } # COSE Algorithms for Signature with EC2. @@ -280,10 +280,10 @@ "ESP512": -52, # ECDSA using P-521 curve and SHA-512 "ESP384": -51, # ECDSA using P-384 curve and SHA-384 "ES256K": -47, # ECDSA using secp256k1 curve and SHA-256 - "ES512": -36, # ECDSA w/ SHA-512 (any curve is not specified but python-cwt uses P-521 curve) - "ES384": -35, # ECDSA w/ SHA-384 (any curve is not specified but python-cwt uses P-384 curve) + "ES512": -36, # ECDSA w/ SHA-512 (Deprecated by RFC 9864; python-cwt uses P-521 curve) + "ES384": -35, # ECDSA w/ SHA-384 (Deprecated by RFC 9864; python-cwt uses P-384 curve) "ESP256": -9, # ECDSA using P-256 curve and SHA-256 - "ES256": -7, # ECDSA w/ SHA-256 (any curve is not specified but python-cwt uses P-256 curve) + "ES256": -7, # ECDSA w/ SHA-256 (Deprecated by RFC 9864; python-cwt uses P-256 curve) } # COSE Algorithms for Signature with RSA. @@ -303,13 +303,15 @@ "RS512": -259, "RS384": -258, "RS256": -257, + "Ed448": -53, "ES256K": -47, "PS512": -39, "PS384": -38, "PS256": -37, "ES512": -36, "ES384": -35, - "EdDSA": -8, + "Ed25519": -19, + "EdDSA": -8, # Deprecated by RFC 9864 "ES256": -7, "dir": -6, "A128GCM": 1, diff --git a/docs/algorithms.rst b/docs/algorithms.rst index fa398b6c..c7c385b2 100644 --- a/docs/algorithms.rst +++ b/docs/algorithms.rst @@ -75,7 +75,8 @@ COSE Algorithms +------------------------+--------+-------+-----------------------------------------------------+ | RS256 | ✅ | -257 | RSASSA-PKCS1-v1_5 using SHA-256 | +------------------------+--------+-------+-----------------------------------------------------+ -| Ed448 | ✅ | -53 | EdDSA using Ed448 curve | +| Ed448 | ✅ | -53 | | EdDSA using the Ed448 parameter set in | +| | | | | Section 5.2 of RFC 8032 | +------------------------+--------+-------+-----------------------------------------------------+ | ESP512 | ✅ | -52 | ECDSA using P-521 curve and SHA-512 | +------------------------+--------+-------+-----------------------------------------------------+ @@ -105,9 +106,9 @@ COSE Algorithms +------------------------+--------+-------+-----------------------------------------------------+ | PS256 | ✅ | -37 | RSASSA-PSS w/ SHA-256 | +------------------------+--------+-------+-----------------------------------------------------+ -| ES512 | ✅ | -36 | ECDSA w/ SHA-512 | +| ES512 | ✅ | -36 | ECDSA w/ SHA-512 (Deprecated) | +------------------------+--------+-------+-----------------------------------------------------+ -| ES384 | ✅ | -35 | ECDSA w/ SHA-384 | +| ES384 | ✅ | -35 | ECDSA w/ SHA-384 (Deprecated) | +------------------------+--------+-------+-----------------------------------------------------+ | ECDH-SS + A256KW | ✅ | -34 | | ECDH SS w/ Concat KDF and AES Key Wrap | | | | | | w/ 256-bit key | @@ -135,7 +136,8 @@ COSE Algorithms +------------------------+--------+-------+-----------------------------------------------------+ | ECDH-ES + HKDF-256 | ✅ | -25 | ECDH ES w/ HKDF - generate key directly | +------------------------+--------+-------+-----------------------------------------------------+ -| Ed25519 | ✅ | -19 | EdDSA using Ed25519 curve | +| Ed25519 | ✅ | -19 | | EdDSA using the Ed25519 parameter set in | +| | | | | Section 5.1 of RFC 8032 | +------------------------+--------+-------+-----------------------------------------------------+ | SHAKE128 | | -18 | SHAKE-128 256-bit Hash Value | +------------------------+--------+-------+-----------------------------------------------------+ @@ -157,9 +159,9 @@ COSE Algorithms +------------------------+--------+-------+-----------------------------------------------------+ | ESP256 | ✅ | -9 | ECDSA using P-256 curve and SHA-256 | +------------------------+--------+-------+-----------------------------------------------------+ -| EdDSA | ✅ | -8 | EdDSA | +| EdDSA | ✅ | -8 | EdDSA (Deprecated) | +------------------------+--------+-------+-----------------------------------------------------+ -| ES256 | ✅ | -7 | ECDSA w/ SHA-256 | +| ES256 | ✅ | -7 | ECDSA w/ SHA-256 (Deprecated) | +------------------------+--------+-------+-----------------------------------------------------+ | direct | ✅ | -6 | Direct use of CEK | +------------------------+--------+-------+-----------------------------------------------------+ diff --git a/tests/test_cose_sample_with_encode.py b/tests/test_cose_sample_with_encode.py index 7a47287c..54b581b7 100644 --- a/tests/test_cose_sample_with_encode.py +++ b/tests/test_cose_sample_with_encode.py @@ -55,7 +55,7 @@ def test_cose_usage_examples_cose_mac0_countersignature(self): "kid": "01", "kty": "OKP", "crv": "Ed25519", - "alg": "EdDSA", + "alg": "Ed25519", "x": "2E6dX83gqD_D0eAmqnaHe1TC1xuld6iAKXfw2OVATr0", "d": "L8JS08VsFZoZxGa9JvzYmCWOwg7zaKcei3KZmYsj7dc", }, @@ -68,7 +68,7 @@ def test_cose_usage_examples_cose_mac0_countersignature(self): "kid": "01", "kty": "OKP", "crv": "Ed25519", - "alg": "EdDSA", + "alg": "Ed25519", "x": "2E6dX83gqD_D0eAmqnaHe1TC1xuld6iAKXfw2OVATr0", }, ) @@ -79,7 +79,7 @@ def test_cose_usage_examples_cose_mac0_countersignature(self): except Exception as err: pytest.fail(f"failed to verify: {err}") countersignature = COSEMessage.from_cose_signature(sig) - assert countersignature.protected[1] == -8 # alg: "EdDSA" + assert countersignature.protected[1] == -19 # alg: "Ed25519" assert countersignature.unprotected[4] == b"01" # kid: b"01" def test_cose_usage_examples_cose_mac_direct(self): @@ -295,7 +295,7 @@ def test_cose_usage_examples_cose_mac_countersignature(self): "kid": "01", "kty": "OKP", "crv": "Ed25519", - "alg": "EdDSA", + "alg": "Ed25519", "x": "2E6dX83gqD_D0eAmqnaHe1TC1xuld6iAKXfw2OVATr0", "d": "L8JS08VsFZoZxGa9JvzYmCWOwg7zaKcei3KZmYsj7dc", }, @@ -310,7 +310,7 @@ def test_cose_usage_examples_cose_mac_countersignature(self): "kid": "01", "kty": "OKP", "crv": "Ed25519", - "alg": "EdDSA", + "alg": "Ed25519", "x": "2E6dX83gqD_D0eAmqnaHe1TC1xuld6iAKXfw2OVATr0", }, ) @@ -321,7 +321,7 @@ def test_cose_usage_examples_cose_mac_countersignature(self): except Exception as err: pytest.fail(f"failed to verify: {err}") countersignature = COSEMessage.from_cose_signature(sig) - assert countersignature.protected[1] == -8 # alg: "EdDSA" + assert countersignature.protected[1] == -19 # alg: "Ed25519" assert countersignature.unprotected[4] == b"01" # kid: b"01" def test_cose_usage_examples_cose_mac_hpke(self): @@ -445,7 +445,7 @@ def test_cose_usage_examples_cose_encrypt0_countersignature(self): "kid": "01", "kty": "OKP", "crv": "Ed25519", - "alg": "EdDSA", + "alg": "Ed25519", "x": "2E6dX83gqD_D0eAmqnaHe1TC1xuld6iAKXfw2OVATr0", "d": "L8JS08VsFZoZxGa9JvzYmCWOwg7zaKcei3KZmYsj7dc", }, @@ -458,7 +458,7 @@ def test_cose_usage_examples_cose_encrypt0_countersignature(self): "kid": "01", "kty": "OKP", "crv": "Ed25519", - "alg": "EdDSA", + "alg": "Ed25519", "x": "2E6dX83gqD_D0eAmqnaHe1TC1xuld6iAKXfw2OVATr0", }, ) @@ -469,7 +469,7 @@ def test_cose_usage_examples_cose_encrypt0_countersignature(self): except Exception as err: pytest.fail(f"failed to verify: {err}") countersignature = COSEMessage.from_cose_signature(sig) - assert countersignature.protected[1] == -8 # alg: "EdDSA" + assert countersignature.protected[1] == -19 # alg: "Ed25519" assert countersignature.unprotected[4] == b"01" # kid: b"01" def test_cose_usage_examples_cose_encrypt0_hpke(self): @@ -570,7 +570,7 @@ def test_cose_usage_examples_cose_encrypt_countersignature(self): "kid": "01", "kty": "OKP", "crv": "Ed25519", - "alg": "EdDSA", + "alg": "Ed25519", "x": "2E6dX83gqD_D0eAmqnaHe1TC1xuld6iAKXfw2OVATr0", "d": "L8JS08VsFZoZxGa9JvzYmCWOwg7zaKcei3KZmYsj7dc", }, @@ -583,7 +583,7 @@ def test_cose_usage_examples_cose_encrypt_countersignature(self): "kid": "01", "kty": "OKP", "crv": "Ed25519", - "alg": "EdDSA", + "alg": "Ed25519", "x": "2E6dX83gqD_D0eAmqnaHe1TC1xuld6iAKXfw2OVATr0", }, ) @@ -595,7 +595,7 @@ def test_cose_usage_examples_cose_encrypt_countersignature(self): except Exception as err: pytest.fail(f"failed to verify: {err}") countersignature = COSEMessage.from_cose_signature(sig) - assert countersignature.protected[1] == -8 # alg: "EdDSA" + assert countersignature.protected[1] == -19 # alg: "Ed25519" assert countersignature.unprotected[4] == b"01" # kid: b"01" def test_cose_usage_examples_cose_encrypt_hpke(self): @@ -1002,7 +1002,7 @@ def test_cose_usage_examples_cose_signature1_countersignature(self): "kid": "01", "kty": "OKP", "crv": "Ed25519", - "alg": "EdDSA", + "alg": "Ed25519", "x": "2E6dX83gqD_D0eAmqnaHe1TC1xuld6iAKXfw2OVATr0", "d": "L8JS08VsFZoZxGa9JvzYmCWOwg7zaKcei3KZmYsj7dc", }, @@ -1024,7 +1024,7 @@ def test_cose_usage_examples_cose_signature1_countersignature(self): "kid": "01", "kty": "OKP", "crv": "Ed25519", - "alg": "EdDSA", + "alg": "Ed25519", "x": "2E6dX83gqD_D0eAmqnaHe1TC1xuld6iAKXfw2OVATr0", }, ) @@ -1035,7 +1035,7 @@ def test_cose_usage_examples_cose_signature1_countersignature(self): except Exception as err: pytest.fail(f"failed to verify: {err}") countersignature = COSEMessage.from_cose_signature(sig) - assert countersignature.protected[1] == -8 # alg: "EdDSA" + assert countersignature.protected[1] == -19 # alg: "Ed25519" assert countersignature.unprotected[4] == b"01" # kid: b"01" def test_cose_usage_examples_cose_signature(self): @@ -1097,7 +1097,7 @@ def test_cose_usage_examples_cose_signature_countersignature(self): "kty": "OKP", "kid": "n01", "crv": "Ed25519", - "alg": "EdDSA", + "alg": "Ed25519", "x": "2E6dX83gqD_D0eAmqnaHe1TC1xuld6iAKXfw2OVATr0", "d": "L8JS08VsFZoZxGa9JvzYmCWOwg7zaKcei3KZmYsj7dc", }, @@ -1128,7 +1128,7 @@ def test_cose_usage_examples_cose_signature_countersignature(self): "kty": "OKP", "kid": "n01", "crv": "Ed25519", - "alg": "EdDSA", + "alg": "Ed25519", "x": "2E6dX83gqD_D0eAmqnaHe1TC1xuld6iAKXfw2OVATr0", }, ) @@ -1141,7 +1141,7 @@ def test_cose_usage_examples_cose_signature_countersignature(self): except Exception as err: pytest.fail(f"failed to verify: {err}") countersignature = COSEMessage.from_cose_signature(sig) - assert countersignature.protected[COSEHeaders.ALG] == COSEAlgs.EDDSA + assert countersignature.protected[COSEHeaders.ALG] == COSEAlgs.ED25519 assert countersignature.unprotected[COSEHeaders.KID] == b"n01" def test_cose_usage_examples_detached_cose_sign_with_countersignature(self): @@ -1175,7 +1175,7 @@ def test_cose_usage_examples_detached_cose_sign_with_countersignature(self): "kty": "OKP", "kid": "n01", "crv": "Ed25519", - "alg": "EdDSA", + "alg": "Ed25519", "x": "2E6dX83gqD_D0eAmqnaHe1TC1xuld6iAKXfw2OVATr0", "d": "L8JS08VsFZoZxGa9JvzYmCWOwg7zaKcei3KZmYsj7dc", }, @@ -1213,7 +1213,7 @@ def test_cose_usage_examples_detached_cose_sign_with_countersignature(self): "kty": "OKP", "kid": "n01", "crv": "Ed25519", - "alg": "EdDSA", + "alg": "Ed25519", "x": "2E6dX83gqD_D0eAmqnaHe1TC1xuld6iAKXfw2OVATr0", }, ) @@ -1231,5 +1231,5 @@ def test_cose_usage_examples_detached_cose_sign_with_countersignature(self): except Exception as err: pytest.fail(f"failed to verify: {err}") countersignature = COSEMessage.from_cose_signature(sig) - assert countersignature.protected[COSEHeaders.ALG] == COSEAlgs.EDDSA + assert countersignature.protected[COSEHeaders.ALG] == COSEAlgs.ED25519 assert countersignature.unprotected[COSEHeaders.KID] == b"n01"