Skip to content

Commit 7b2d707

Browse files
maxtropetsCopilotachamayou
authored
Use CBOR wrappers for COSE receipts decoding (#7575)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Amaury Chamayou <amaury@xargs.fr>
1 parent 4eacec6 commit 7b2d707

3 files changed

Lines changed: 193 additions & 385 deletions

File tree

include/ccf/receipt.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,14 @@ namespace ccf
142142
MERKLE_PROOF_LEAF_LABEL = 1,
143143
MERKLE_PROOF_PATH_LABEL = 2
144144
};
145+
// NOLINTNEXTLINE(performance-enum-size)
146+
enum MerkleProofPathBranch : int64_t
147+
{
148+
// Values set in
149+
// https://github.com/ietf-scitt/draft-birkholz-cose-cometre-ccf-profile
150+
LEFT = 0,
151+
RIGHT = 1
152+
};
145153
std::optional<std::vector<uint8_t>> describe_merkle_proof_v1(
146154
const TxReceiptImpl& receipt);
147155

src/crypto/openssl/cose_sign.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ namespace ccf::crypto
1919
// Standardised: CWT claims map.
2020
static constexpr int64_t COSE_PHEADER_KEY_CWT = 15;
2121
// Standardised: verifiable data structure.
22+
// https://www.ietf.org/archive/id/draft-ietf-cose-merkle-tree-proofs-18.html#name-cose-header-parameter
2223
static constexpr int64_t COSE_PHEADER_KEY_VDS = 395;
2324
static constexpr int64_t COSE_PHEADER_VDS_CCF_LEDGER_SHA256 = 2;
2425
// Standardised: issued at CWT claim. Value is **PLAIN INTEGER**, as per

0 commit comments

Comments
 (0)