jiebi/CodeConvo huggingface dataset:
Abstract <del> This document describes a tree algorithm for COSE Signed Merkle Tree Proofs specifically designed for implementations that rely on Trusted Execution Environments (TEEs) to make the tree more tamper-resistant. </del> <ins> This document defines a new verifiable data structure type for COSE Signed Merkle Tree Proofs specifically designed for implementations that rely on Trusted Execution Environments (TEEs) to provide stronger tamper-evidence guarantees. </ins> 1. The Concise Encoding of Signed Merkle Tree Proofs (CoMeTre) I- <del> D.steele-cose-merkle-tree-proofs defines a standard format for carrying COSE-encoded Merkle Tree proofs and the associated signed root value.  This is helpful to pove to a verifier that a given serializable element is recorded at a given index in the Merkle Tree, or to prove that a tree is an extension of another. In this document, we describe how to verify such CoMeTre proofs for a new type of trees associated with the Confidential Consortium Framework (CCF).  Compared to RFC9162, the leaves of CCF trees carry additional opaque infomation that is used to verify that elements are only written by the Trusted Execution Environment, which addresses the persistance of committed transactions that happen between new signatures of the Merkle Tree root. </del> <ins> D.steele-cose-merkle-tree-proofs defines a common framework for defining different types of proofs, such as proof of inclusion, about verifiable data structures (also abbreviated as "logs" in this document).  For instance, inclusion proofs guarantee to a verifier that a given serializable element is recorded at a given state of the log, while consistency proofs are used to establish that an inclusion proof is still consistent with the new state of the log at a later time. In this document, we define a new type of log, associated with the Confidential Consortium Framework (CCF) ledger.  Compared to RFC9162, the leaves of CCF trees carry additional opaque information that is used to verify that elements are only written by the Trusted Execution Environment, which addresses the persistence of committed transactions that happen between new signatures of the Merkle Tree root. </ins> 1.1.
2. <del> Recall the definition of CoMeTre inclusion proofs, which are parametrized by 3 CBOR data types that are specific to the Tree Algorithm: This document defines the "CCF-leaf" and "CCF-inclusion-proof" CBOR types.  The signed Merkle Root data type "smtr" is the same as in I- D.steele-cose-merkle-tree-proofs but MUST set the protected header parameter carrying the identifier of the tree algorithm, "tree_alg", to the value TBD_1. </del> <ins> This documents extends the verifiable data structure registry of I- D.steele-cose-merkle-tree-proofs with the following value: </ins> 2.1. <del> The input of the Merkle Tree Hash (MTH) function is a list of n bytestrings, written D_n = {d[0], d[1], ..., d[n-1]}. The output is a single HASH_SIZE bytestring, also called the tree root hash. </del> <ins> The input of the Merkle Tree Hash (MTH) function is a list of n byte strings, written D_n = {d[0], d[1], ..., d[n-1]}. The output is a single HASH_SIZE byte string, also called the Merkle root hash. </ins> This function is defined as follows:
<del> A CoMETRE Profile and Tree Algorithm for the Confidential Consortium Framework </del> <ins> COSE Receipts with CCF </ins> draft-birkholz-cose-cometre-ccf-profile-latest Abstract This document defines a new verifiable data structure type for COSE <del> Signed Merkle Tree Proofs specifically designed for implementations that rely on Trusted Execution Environments (TEEs) to provide stronger tamper-evidence guarantees. </del> <ins> Signed Merkle Tree Proofs specifically designed for transaction ledgers produced by Trusted Execution Environments (TEEs), such as the Confidential Consortium Framework (CCF) to provide stronger tamper-evidence guarantees. </ins> 1. The Concise Encoding of Signed Merkle Tree Proofs (CoMeTre) I- D.steele-cose-merkle-tree-proofs defines a common framework for defining different types of proofs, such as proof of inclusion, about <del> verifiable data structures (also abbreviated as "logs" in this document).  For instance, inclusion proofs guarantee to a verifier that a given serializable element is recorded at a given state of the log, while consistency proofs are used to establish that an inclusion proof is still consistent with the new state of the log at a later time. In this document, we define a new type of log, associated with the Confidential Consortium Framework (CCF) ledger.  Compared to RFC9162, the leaves of CCF trees carry additional opaque information that is used to verify that elements are only written by the Trusted Execution Environment, which addresses the persistence of committed transactions that happen between new signatures of the Merkle Tree root. </del> <ins> verifiable data structures (VDS).  For instance, inclusion proofs guarantee to a verifier that a given serializable element is recorded at a given state of the VDS, while consistency proofs are used to establish that an inclusion proof is still consistent with the new state of the VDS at a later time. In this document, we define a new type of VDS, associated with the Confidential Consortium Framework (CCF) ledger.  This VDS carries indexed transaction information in a binary Merkle Tree, where new transactions are appended to the right, so that the binary decomposition of the index of a transaction can be interpreted as the position in the tree if 0 represents the left branch and 1 the right branch.  Compared to RFC9162, the leaves of CCF trees carry additional internal information for the following purposes: To bind the full details of the transaction executed, which is a super-set of what is exposed in the proof and captures internal information details useful for detailed system audit, but not for application purposes. To verify that elements are only written by the Trusted Execution Environment, which addresses the persistence of committed transactions that happen between new signatures of the Merkle Tree root. </ins> 1.1.
This documents extends the verifiable data structure registry of I- D.steele-cose-merkle-tree-proofs with the following value: <ins> This document defines inclusion proofs for CCF ledgers.  Verifiers MUST reject all other proof types </ins> 2.1. <del> The input of the Merkle Tree Hash (MTH) function is a list of n byte strings, written D_n = {d[0], d[1], ..., d[n-1]}. The output is a single HASH_SIZE byte string, also called the Merkle root hash. </del> <ins> A CCF ledger is a binary Merkle Tree constructed from a hash function H, which is defined from the log type.  For instance, the hash function for "CCF_LEDGER_SHA256" is "SHA256", whose "HASH_SIZE" is 32 bytes. The Merkle tree encodes an ordered list of "n" transactions T_n = {T[0], T[1], ..., T[n-1]}. We define the Merkle Tree Hash (MTH) function, which takes as input a list of serialized transactions (as byte strings), and outputs a single HASH_SIZE byte string called the Merkle root hash, by induction on the list: </ins> This function is defined as follows:
Each leaf in a CCF ledger carries the following components: <del> The "internal_hash" and "internal_data" byte strings are internal to the CCF implementation.  Similarly, the auxiliary tree entries are internal to CCF.  They are opaque to receipt Verifiers, but they commit the TS to the whole tree contents and may be used for additional, CCF-specific auditing. </del> <ins> The "internal-transaction-hash" and "internal-evidence" byte strings are internal to the CCF implementation.  They can be safely ignored by receipt Verifiers, but they commit the TS to the whole tree contents and may be used for additional, CCF-specific auditing. </ins> 3.
the verifiable data structure algorithm identifier for "ccf- ledger" (TBD_1). <del> "proof-type: int".  This header MUST be set to the value of the </del> <ins> "label: int".  This header MUST be set to the value of the </ins> "inclusion" proof type in the IANA registry of Verifiable Data <del> Structure Proof Type. </del> <ins> Structure Proof Type (-1). </ins> The unprotected header for a CCF inclusion proof signature MUST include the following:
"inclusion-proof: bstr .cbor CCF-inclusion-proof".  This contains the serialized CCF inclusion proof, as defined above. <del> "leaf" (label TBD_2): "bstr .cbor CCF-leaf".  This contains the CCF-specific serialization of the leaf element The payload of the signature is the CCF ledger Markle root digest, </del> <ins> The payload of the signature is the CCF ledger Merkle root digest, </ins> and MUST be detached in order to force verifiers to recompute the root from the inclusion proof in the unprotected header.  This provides a safeguard against implementation errors that use the
Reference: This document <ins> Label: TBD_3 Value type: "bstr" Reference: This document </ins> 6.1.2. This document requests IANA to add the following new value to the <del> 'Tree Algorithms' registry: </del> <ins> ''COSE Verifiable Data Structures' registry: Name: CCF_LEDGER_SHA256 </ins> <del> Identifier: TBD_1 (requested assignment 2) </del> <ins> Value: TBD_1 (requested assignment 2) </ins> <del> Tree Algorithm: ccf-ledger </del> <ins> Description: Historical transaction ledgers, such as the CCF ledger </ins> Reference: This document
6.1.1. This document requests IANA to add the following new value to the <del> 'COSE Header Parameters' registry: Label: TBD_2 (requested assignment 36) Value type: ccf-leaf Reference: This document Label: TBD_3 (requested assignment 37) Value type: [+ ccf-proof-element] Reference: This document 6.1.2. This document requests IANA to add the following new value to the ''COSE Verifiable Data Structures' registry: </del> <ins> 'COSE Verifiable Data Structures' registry: </ins> Name: CCF_LEDGER_SHA256 Value: TBD_1 (requested assignment 2) <del> Description: Historical transaction ledgers, such as the CCF ledger </del> <ins> Description: Historical transaction ledgers produced by Trusted Execution Environments, such as the CCF ledger </ins> Reference: This document
Name: CCF_LEDGER_SHA256 <del> Value: TBD_1 (requested assignment 2) </del> <ins> Value: 2 (requested assignment) </ins> <del> Description: Historical transaction ledgers produced by Trusted Execution Environments, such as the CCF ledger </del> <ins> Description: Append-only logs that are integrity-protected by a Merkle Tree and signatures produced via Trusted Execution Environments containing a mix of public and confidential information, as specified by the Confidential Consortium Framework. </ins> Reference: This document
This documents extends the verifiable data structure registry of I- D.ietf-cose-merkle-tree-proofs with the following value: <del> This document defines inclusion proofs for CCF ledgers.  Verifiers MUST reject all other proof types </del> <ins> This document defines inclusion proofs for CCF ledgers. Corresponding CCF Verifiers MUST reject proof types they do not support. </ins> 2.1.
structure, together with the hash itself. As part of the signature verification, the receiver MUST make sure <del> that the message imprint in the embedded timestamp token matches either the payload or the signature fields, depending on the mode of use. </del> <ins> that the message imprint in the embedded timestamp token matches a hash of either the payload, signature, or signature fields, depending on the mode of use and type of COSE structure. </ins> RFC3161 provides an example that illustrates how timestamp tokens can be used to verify signatures of a timestamped message when utilizing
header parameter MUST be used for the mode described in sec- timestamp-then-cose. <del> The "3161-ttc" protected header is defined as follows: Name: 3161-ttc Label: TBD Value Type: bstr Value Registry: Description: RFC 3161 timestamp token Reference: sec-tst-hdr-ttc of RFCthis The content of the byte string are the bytes of the DER-encoded RFC 3161 TimeStampToken structure. </del> <ins> The "3161-ttc" protected header parameter contains a DER-encoded RFC3161 TimeStampToken wrapped in a CBOR byte string (Major type 2). </ins> 3.2.
may not be possible if the timestamp token has been obtained outside the processing context in which the COSE object is assembled. <del> The "3161-ctt" unprotected header is defined as follows: Name: 3161-ctt Label: TBD Value Type: bstr Value Registry: Description: RFC 3161 timestamp token Reference: sec-tst-hdr-ctt of RFCthis </del> <ins> The "3161-ctt" unprotected header parameter contains a DER-encoded RFC3161 TimeStampToken wrapped in a CBOR byte string (Major type 2). </ins> 4.
6. <del> IANA is requested to add the two COSE header parameters described in sec-tst-hdr to the "COSE Header Parameters" registry in the IANA.cose registry group. </del> <ins> IANA is requested to add the COSE header parameters defined in tbl- new-hdrs to the "COSE Header Parameters" registry IANA.cose_header- parameters. </ins>
5. <del> The security considerations made in RFC3161 as well as those of RFC9338 apply. </del> <ins> Please review the Security Considerations section in RFC3161; these considerations apply to this document as well. Also review the Security Considerations section in STD96; these considerations apply to this document as well, especially the need for implementations to protect private key material. </ins> In the "Timestamp, then COSE" (TTC) sequence of operation, the TSA is given an opaque identifier (a cryptographic hash value) for the
considerations apply to this document as well, especially the need for implementations to protect private key material. <del> In the "Timestamp, then COSE" (TTC) sequence of operation, the TSA is given an opaque identifier (a cryptographic hash value) for the payload.  While this means that the content of the payload is not directly revealed, to prevent comparison with known payloads or disclosure of identical payloads being used over time, the payload would need to be armored, e.g., with a nonce that is shared with the recipient of the header parameter but not the TSA.  Such a mechanism can be employed inside the ones described in this specification, but is out of scope for this document. </del> <ins> The following scenario assumes an attacker can manipulate the clocks on the COSE signer and its relying parties, but not the TSA.  It is also assumed that the TSA is a trusted third party, so the attacker cannot impersonate the TSA and create valid timestamp tokens.  In such a setting, any tampering with the COSE signer's clock does not have an impact because, once the timestamp is obtained from the TSA, it becomes the only reliable source of time.  However, in both CTT and TTC mode, a denial of service can occur if the attacker can adjust the relying party's clock so that the CMS validation fails. This could disrupt the timestamp validation. In CTT mode, an attacker could manipulate the unprotected header by removing or replacing the timestamp.  To avoid that, the signed COSE object should be integrity protected during transit and at rest. In TTC mode, the TSA is given an opaque identifier (a cryptographic hash value) for the payload.  While this means that the content of the payload is not directly revealed, to prevent comparison with known payloads or disclosure of identical payloads being used over time, the payload would need to be armored, e.g., with a nonce that is shared with the recipient of the header parameter but not the TSA. Such a mechanism can be employed inside the ones described in this specification, but is out of scope for this document. </ins> 6.
This document defines a CBOR Signing And Encrypted (COSE) header parameter for incorporating RFC 3161-based timestamping into COSE <del> message structures (COSE_Sign and COSE_Sign1).  This enables the use of established RFC 3161 timestamping infrastructure to prove the </del> <ins> message structures ("COSE_Sign" and "COSE_Sign1").  This enables the use of established RFC 3161 timestamping infrastructure to prove the </ins> creation time of a message. 1.
(COSE) STD96 header parameters that carry the TimestampToken (TST) output of RFC 3161, thus allowing existing and widely deployed trust infrastructure to be used with COSE structures used for signing <del> (COSE_Sign and COSE_Sign1). </del> <ins> ("COSE_Sign" and "COSE_Sign1"). </ins> 1.1. <ins> This section discusses two use cases, each representing one of the two modes of use defined in modes. A first use case is a digital document signed alongside a trustworthy timestamp.  This is a common case in legal contracts.  In such scenario, the document signer wants to reinforce the claim that the document existed on a specific date.  To achieve this, the document signer acquires a fresh TST for the document from a TSA, combines it with the document, and then signs the bundle.  Later on, a relying party consuming the signed bundle can be certain that the document existed at the time specified by the TSA.  The relying party does not have to trust the signer's clock, which may have been maliciously altered or simply inaccurate. This usage scenario motivates the "Timestamp then COSE" mode defined in sec-timestamp-then-cose. A second use case is the notarization of a signed document by registering it at a Transparency Service.  This is common for accountability and auditability of issued documents.  Once a document is registered at a Transparency Service's append-only log, it cannot be changed.  In certain cases, the registration policy of a Transparency Service may require adding a trustworthy timestamp to the document at the time of registration.  This is done to enhance confidence in the timing of the registration, ensuring that the registration could not have occurred before a certain point in time. To achieve this, the Transparency Service acquires a TST from a TSA, bundles it alongside the signed document, and then registers it.  A relying party that wants to ascertain the time of registration of a given document does not have to trust the Transparency Service's clock, which may have been maliciously altered or can simply be inaccurate. This usage scenario motivates the "COSE then Timestamp" mode described in sec-cose-then-timestamp. 1.2. </ins> The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in
There are two different modes of composing COSE protection and timestamping, motivated by the usage scenarios discussed above. <ins> The diagrams in this section illustrate the processing flow of the specified modes.  For simplicity, only the "COSE_Sign1" processing is shown.  Similar diagrams for "COSE_Sign" can be derived by allowing multiple "private-key" boxes and replacing the label "[signature]" with "[signatures]". </ins> 2.1. fig-timestamp-then-cose shows the case where a datum is first
The message imprint sent in the request to the TSA MUST be either: <del> the hash of the signature field of the COSE_Sign1 message. </del> <ins> the hash of the signature field of the "COSE_Sign1" message. </ins> <del> the hash of the signatures field of the COSE_Sign message. </del> <ins> the hash of the signatures field of the "COSE_Sign" message. </ins> In either case, to minimize dependencies, the hash algorithm SHOULD be the same as the algorithm used for signing the COSE message.  This
3. <del> To carry RFC 3161 timestamp tokens in COSE signed messages, a new COSE header parameter, "rfc3161-tst", is defined as follows: </del> <ins> The two modes described in sec-timestamp-then-cose and sec-cose-then- timestamp use different inputs into the timestamping machinery, and consequently create different kinds of binding between COSE and TST. To clearly separate their semantics two different COSE header parameters are defined as described in the following subsections. 3.1. The "3161-ttc" COSE </ins> <del> Name: rfc3161-tst </del> <ins> header parameter MUST be used for the mode described in sec- timestamp-then-cose. The "3161-ttc" protected header is defined as follows: Name: 3161-ttc </ins> Label: TBD
Description: RFC 3161 timestamp token <del> Reference: RFCthis </del> <ins> Reference: sec-tst-hdr-ttc of RFCthis </ins> The content of the byte string are the bytes of the DER-encoded RFC 3161 TimeStampToken structure. <del> When used as described in sec-timestamp-then-cose, the message imprint sent to the TSA (RFC3161) MUST be the hash of the payload field of the COSE signed object. </del> <ins> 3.2. The "3161-ctt" COSE </ins> <del> When used as described in sec-cose-then-timestamp, the message imprint sent in the request to the TSA MUST be either: </del> <ins> header parameter MUST be used for the mode described in sec-cose- then-timestamp. The message imprint sent in the request to the TSA MUST be either: </ins> the hash of the signature field of the COSE_Sign1.
may not be possible if the timestamp token has been obtained outside the processing context in which the COSE object is assembled. <ins> The "3161-ctt" unprotected header is defined as follows: Name: 3161-ctt Label: TBD Value Type: bstr Value Registry: none Description: RFC 3161 timestamp token Reference: sec-tst-hdr-ctt of RFCthis 4. </ins> RFC 3161 timestamp tokens use CMS as signature envelope format. STD70 provides the details about signature verification, and RFC3161 provides the details specific to timestamp token validation.  The
As part of the signature verification, the receiver MUST make sure that the message imprint in the embedded timestamp token matches either the payload or the signature fields, depending on the mode of <del> use.. </del> <ins> use. </ins> <del> Guidance is illustrated in RFC3161 via an example that shows how timestamp tokens can be used during signature verification of a timestamped message when using X.509 certificates. </del> <ins> RFC3161 provides an example that illustrates how timestamp tokens can be used to verify signatures of a timestamped message when utilizing X.509 certificates. </ins> <del> 4. </del> <ins> 5. </ins> The security considerations made in RFC3161 as well as those of RFC9338 apply. <del> 5. </del> <ins> 6. </ins> <del> IANA is requested to add the COSE Header parameter described in sec- tst-hdr to the "COSE Header Parameters" of the IANA.cose registry. </del> <ins> IANA is requested to add the two COSE Header parameters described in sec-tst-hdr to the "COSE Header Parameters" of the IANA.cose registry. </ins>
Trust in the TS itself is supported both by protecting their implementation (using, for instance, replication, trusted hardware, <del> and system attestation) and by enabling independent audits of the correctness and consistency of its ledger, thereby holding the </del> <ins> and remote attestation of systems) and by enabling independent audits of the correctness and consistency of its ledger, thereby holding the </ins> organization accountable that operates it.  Unlike CT, where independent auditors are responsible for enforcing the consistency of multiple independent instances of the same global ledger, we require
Custom policies may use additional information present in the ledger outside of claims.  For instance, issuers may have to register on the TS before claims can be accepted; a custom policy may be used to <del> enforce access control to the transparency service.  Similarly, policies may be used </del> <ins> enforce access control to the transparency service.  Verifying the signature of the issuer is also a form of registration policy, but it is globally enforced in order to separate authentication and authorization, with policy only considering authentic inputs. </ins> tbl-initial-named-policies defines an initial set of named policies that TS may decide to enforce.  This may be evolved in future drafts.