Lines Matching refs:bytevec

31 ErrMsgOr<bssl::UniquePtr<EVP_CIPHER_CTX>> aesGcmInitAndProcessAad(const bytevec& key,  in aesGcmInitAndProcessAad()
32 const bytevec& nonce, in aesGcmInitAndProcessAad()
33 const bytevec& aad, in aesGcmInitAndProcessAad()
56 ErrMsgOr<HmacSha256> generateHmacSha256(const bytevec& key, const bytevec& data) { in generateHmacSha256()
70 ErrMsgOr<HmacSha256> generateCoseMac0Mac(HmacSha256Function macFunction, const bytevec& externalAad, in generateCoseMac0Mac()
71 const bytevec& payload) { in generateCoseMac0Mac()
88 const bytevec& externalAad, const bytevec& payload) { in constructCoseMac0()
99 ErrMsgOr<bytevec /* payload */> verifyAndParseCoseMac0(const cppbor::Item* macItem, in verifyAndParseCoseMac0()
100 const bytevec& macKey) { in verifyAndParseCoseMac0()
123 auto macFunction = [&macKey](const bytevec& input) { in verifyAndParseCoseMac0()
137 ErrMsgOr<bytevec> createCoseSign1Signature(const bytevec& key, const bytevec& protectedParams, in createCoseSign1Signature()
138 const bytevec& payload, const bytevec& aad) { in createCoseSign1Signature()
139 bytevec signatureInput = cppbor::Array() in createCoseSign1Signature()
147 bytevec signature(ED25519_SIGNATURE_LEN); in createCoseSign1Signature()
155 ErrMsgOr<cppbor::Array> constructCoseSign1(const bytevec& key, cppbor::Map protectedParams, in constructCoseSign1()
156 const bytevec& payload, const bytevec& aad) { in constructCoseSign1()
157 bytevec protParms = protectedParams.add(ALGORITHM, EDDSA).canonicalize().encode(); in constructCoseSign1()
168 ErrMsgOr<cppbor::Array> constructCoseSign1(const bytevec& key, const bytevec& payload, in constructCoseSign1()
169 const bytevec& aad) { in constructCoseSign1()
173 ErrMsgOr<bytevec> verifyAndParseCoseSign1(const cppbor::Array* coseSign1, in verifyAndParseCoseSign1()
174 const bytevec& signingCoseKey, const bytevec& aad) { in verifyAndParseCoseSign1()
211 bytevec signatureInput = in verifyAndParseCoseSign1()
222 ErrMsgOr<bytevec> createCoseEncryptCiphertext(const bytevec& key, const bytevec& nonce, in createCoseEncryptCiphertext()
223 const bytevec& protectedParams, in createCoseEncryptCiphertext()
224 const bytevec& plaintextPayload, const bytevec& aad) { in createCoseEncryptCiphertext()
237 ErrMsgOr<cppbor::Array> constructCoseEncrypt(const bytevec& key, const bytevec& nonce, in constructCoseEncrypt()
238 const bytevec& plaintextPayload, const bytevec& aad, in constructCoseEncrypt()
256 ErrMsgOr<std::pair<bytevec /* pubkey */, bytevec /* key ID */>>
318 return std::make_pair(pubkey->asBstr()->value(), bytevec{}); in getSenderPubKeyFromCoseEncrypt()
321 ErrMsgOr<bytevec> decryptCoseEncrypt(const bytevec& key, const cppbor::Item* coseEncrypt, in decryptCoseEncrypt()
322 const bytevec& external_aad) { in decryptCoseEncrypt()
370 ErrMsgOr<bytevec> x25519_HKDF_DeriveKey(const bytevec& pubKeyA, const bytevec& privKeyA, in x25519_HKDF_DeriveKey()
371 const bytevec& pubKeyB, bool senderIsA) { in x25519_HKDF_DeriveKey()
376 bytevec rawSharedKey(X25519_SHARED_KEY_LEN); in x25519_HKDF_DeriveKey()
381 bytevec kdfContext = cppbor::Array() in x25519_HKDF_DeriveKey()
385 .add(bytevec{} /* nonce */) in x25519_HKDF_DeriveKey()
389 .add(bytevec{} /* nonce */) in x25519_HKDF_DeriveKey()
393 .add(bytevec{})) // protected in x25519_HKDF_DeriveKey()
396 bytevec retval(SHA256_DIGEST_LENGTH); in x25519_HKDF_DeriveKey()
397 bytevec salt{}; in x25519_HKDF_DeriveKey()
409 ErrMsgOr<bytevec> aesGcmEncrypt(const bytevec& key, const bytevec& nonce, const bytevec& aad, in aesGcmEncrypt()
410 const bytevec& plaintext) { in aesGcmEncrypt()
414 bytevec ciphertext(plaintext.size() + kAesGcmTagSize); in aesGcmEncrypt()
435 ErrMsgOr<bytevec> aesGcmDecrypt(const bytevec& key, const bytevec& nonce, const bytevec& aad, in aesGcmDecrypt()
436 const bytevec& ciphertextWithTag) { in aesGcmDecrypt()
442 bytevec plaintext(ciphertextWithTag.size() - kAesGcmTagSize); in aesGcmDecrypt()
450 bytevec tag(ciphertextWithTag.end() - kAesGcmTagSize, ciphertextWithTag.end()); in aesGcmDecrypt()