Lines Matching refs:cppbor

239     auto macStructure = cppbor::Array()  in generateCoseMac0Mac()
241 .add(cppbor::Map().add(ALGORITHM, HMAC_256).canonicalize().encode()) in generateCoseMac0Mac()
254 ErrMsgOr<cppbor::Array> constructCoseMac0(HmacSha256Function macFunction, in constructCoseMac0()
259 return cppbor::Array() in constructCoseMac0()
260 .add(cppbor::Map().add(ALGORITHM, HMAC_256).canonicalize().encode()) in constructCoseMac0()
261 .add(cppbor::Map() /* unprotected */) in constructCoseMac0()
266 ErrMsgOr<bytevec /* payload */> verifyAndParseCoseMac0(const cppbor::Item* macItem, in verifyAndParseCoseMac0()
281 auto [protectedMap, _, errMsg] = cppbor::parse(protectedParms); in verifyAndParseCoseMac0()
306 bytevec signatureInput = cppbor::Array() in createECDSACoseSign1Signature()
320 bytevec signatureInput = cppbor::Array() in createCoseSign1Signature()
336 ErrMsgOr<cppbor::Array> constructECDSACoseSign1(const bytevec& key, cppbor::Map protectedParams, in constructECDSACoseSign1()
342 return cppbor::Array() in constructECDSACoseSign1()
344 .add(cppbor::Map() /* unprotected parameters */) in constructECDSACoseSign1()
349 ErrMsgOr<cppbor::Array> constructCoseSign1(const bytevec& key, cppbor::Map protectedParams, in constructCoseSign1()
355 return cppbor::Array() in constructCoseSign1()
357 .add(cppbor::Map() /* unprotected parameters */) in constructCoseSign1()
362 ErrMsgOr<cppbor::Array> constructCoseSign1(const bytevec& key, const bytevec& payload, in constructCoseSign1()
367 ErrMsgOr<bytevec> verifyAndParseCoseSign1(const cppbor::Array* coseSign1, in verifyAndParseCoseSign1()
373 const cppbor::Bstr* protectedParams = coseSign1->get(kCoseSign1ProtectedParams)->asBstr(); in verifyAndParseCoseSign1()
374 const cppbor::Map* unprotectedParams = coseSign1->get(kCoseSign1UnprotectedParams)->asMap(); in verifyAndParseCoseSign1()
375 const cppbor::Bstr* payload = coseSign1->get(kCoseSign1Payload)->asBstr(); in verifyAndParseCoseSign1()
381 auto [parsedProtParams, _, errMsg] = cppbor::parse(protectedParams); in verifyAndParseCoseSign1()
396 const cppbor::Bstr* signature = coseSign1->get(kCoseSign1Signature)->asBstr(); in verifyAndParseCoseSign1()
403 cppbor::Array().add("Signature1").add(*protectedParams).add(aad).add(*payload).encode(); in verifyAndParseCoseSign1()
461 cppbor::Array() // Enc strucure as AAD in createCoseEncryptCiphertext()
472 ErrMsgOr<cppbor::Array> constructCoseEncrypt(const bytevec& key, const bytevec& nonce, in constructCoseEncrypt()
474 cppbor::Array recipients) { in constructCoseEncrypt()
475 auto encryptProtectedHeader = cppbor::Map() // in constructCoseEncrypt()
484 return cppbor::Array() in constructCoseEncrypt()
486 .add(cppbor::Map().add(IV, nonce).canonicalize()) // Unprotected in constructCoseEncrypt()
492 getSenderPubKeyFromCoseEncrypt(const cppbor::Item* coseEncrypt) { in getSenderPubKeyFromCoseEncrypt()
511 cppbor::prettyPrint(ciphertext.get()); in getSenderPubKeyFromCoseEncrypt()
516 auto [parsedProtParms, _, errMsg] = cppbor::parse(protParms->asBstr()); in getSenderPubKeyFromCoseEncrypt()
575 ErrMsgOr<bytevec> decryptCoseEncrypt(const bytevec& key, const cppbor::Item* coseEncrypt, in decryptCoseEncrypt()
591 auto [parsedProtParams, _, errMsg] = cppbor::parse(protParms->asBstr()->value()); in decryptCoseEncrypt()
615 auto aad = cppbor::Array() // Enc strucure as AAD in decryptCoseEncrypt()
630 bytevec kdfContext = cppbor::Array() in consructKdfContext()
632 .add(cppbor::Array() // Sender Info in consructKdfContext()
633 .add(cppbor::Bstr("client")) in consructKdfContext()
636 .add(cppbor::Array() // Recipient Info in consructKdfContext()
637 .add(cppbor::Bstr("server")) in consructKdfContext()
640 .add(cppbor::Array() // SuppPubInfo in consructKdfContext()