@@ -1066,16 +1066,35 @@ They return a [=byte sequence=] or an error.
1066
1066
of « "`aggregation_service`", |sharedInfo| ».
1067
1067
1. Let (|kem_id|, |kdf_id|, |aead_id|) be (0x0020, 0x0001, 0x0003).
1068
1068
1069
- Note: These indicate the HPKE algorithm identifiers, specifying the KEM
1070
- function as DHKEM(X25519, HKDF-SHA256), the KDF function as HKDF-SHA256
1071
- and the AEAD function as ChaCha20Poly1305.
1072
- 1. Let |hpkeContext| be the result of setting up an [[RFC9180|HPKE]]
1073
- [[RFC9180#name-encryption-to-a-public-key|sender's context]] with |pkR|,
1074
- |info|, |kem_id|, |kdf_id| and |aead_id|.
1069
+ Note: The ciphersuite triple above is composed of [[RFC9180|HPKE]]
1070
+ [[RFC9180#name-algorithm-identifiers|algorithm identifiers]] , specifying
1071
+ the [[RFC9180#name-key-encapsulation-mechanism|KEM]] as DHKEM(X25519,
1072
+ HKDF-SHA256), the [[RFC9180#name-key-derivation-functions-kd|KDF]]
1073
+ function as HKDF-SHA256 and the
1074
+ [[RFC9180#name-authenticated-encryption-wi|AEAD]] function as
1075
+ ChaCha20Poly1305.
1076
+ 1. Let (|enc|, |hpkeContext|) be the result of setting up an [[RFC9180|HPKE]]
1077
+ [[RFC9180#name-encryption-to-a-public-key|sender's context]] by calling
1078
+ `SetupBaseS()` with a public key |pkR|, application-supplied information
1079
+ |info|, KEM |kem_id|, KDF |kdf_id|, and AEAD |aead_id|. If this operation
1080
+ fails, return an error.
1081
+
1082
+ Note: For clarity, we explicitly passed the KEM, KDF, and AEAD identifiers
1083
+ to `SetupBaseS()` above, even though RFC9180 omits the parameters from its
1084
+ pseudocode.
1075
1085
1. Let |aad| be \`\` (an empty [=byte sequence=] ).
1076
- 1. Let <var ignore> encryptedPayload</var> be the result of
1077
- [[RFC9180#name-encryption-and-decryption|encrypting]] |plaintextPayload|
1078
- with |hpkeContext| and |aad|.
1086
+ 1. Let |ciphertext| be the result of
1087
+ [[RFC9180#name-encryption-and-decryption|sealing]] the payload by calling
1088
+ `ContextS.Seal()` on the |hpkeContext| object with additional authenticated
1089
+ data |aad| and plaintext |plaintextPayload|. If this operation fails, return
1090
+ an error.
1091
+ 1. Let |encryptedPayload| be the concatenation of the [=byte sequences=] «
1092
+ |enc|, |ciphertext| ».
1093
+
1094
+ Note: The length of the encapsulated symmetric key <var ignore> enc</var>
1095
+ generated by our chosen KEM is exactly 32 bytes, as shown in RFC9180's
1096
+ table of [[RFC9180#name-key-encapsulation-mechanism|KEM IDs]] .
1097
+ 1. Return the [=byte sequence=] |encryptedPayload|.
1079
1098
1080
1099
</div>
1081
1100
0 commit comments