Lines Matching refs:bytevec
39 ErrMsgOr<bssl::UniquePtr<EVP_CIPHER_CTX>> aesGcmInitAndProcessAad(const bytevec& key, in aesGcmInitAndProcessAad()
40 const bytevec& nonce, in aesGcmInitAndProcessAad()
41 const bytevec& aad, in aesGcmInitAndProcessAad()
62 ErrMsgOr<bytevec> signP256Digest(const bytevec& key, const bytevec& data) { in signP256Digest()
78 bytevec signature(len); in signP256Digest()
84 ErrMsgOr<bytevec> ecdh(const bytevec& publicKey, const bytevec& privateKey) { in ecdh()
137 bytevec sharedSecret(secretLen); in ecdh()
145 ErrMsgOr<bytevec> ecdsaCoseSignatureToDer(int point_size, const bytevec& ecdsaCoseSignature) { in ecdsaCoseSignatureToDer()
165 bytevec derSignature(len); in ecdsaCoseSignatureToDer()
171 ErrMsgOr<bytevec> ecdsaDerSignatureToCose(int point_size, const bytevec& ecdsaSignature) { in ecdsaDerSignatureToCose()
178 bytevec ecdsaCoseSignature(point_size * 2, 0); in ecdsaDerSignatureToCose()
190 bool verifyEcdsaDigest(int curve_nid, const bytevec& key, const bytevec& digest, in verifyEcdsaDigest()
191 const bytevec& signature) { in verifyEcdsaDigest()
223 ErrMsgOr<HmacSha256> generateHmacSha256(const bytevec& key, const bytevec& data) { in generateHmacSha256()
237 ErrMsgOr<HmacSha256> generateCoseMac0Mac(HmacSha256Function macFunction, const bytevec& externalAad, in generateCoseMac0Mac()
238 const bytevec& payload) { in generateCoseMac0Mac()
255 const bytevec& externalAad, const bytevec& payload) { in constructCoseMac0()
266 ErrMsgOr<bytevec /* payload */> verifyAndParseCoseMac0(const cppbor::Item* macItem, in verifyAndParseCoseMac0()
267 const bytevec& macKey) { in verifyAndParseCoseMac0()
290 auto macFunction = [&macKey](const bytevec& input) { in verifyAndParseCoseMac0()
304 ErrMsgOr<bytevec> createECDSACoseSign1Signature(const bytevec& key, const bytevec& protectedParams, in createECDSACoseSign1Signature()
305 const bytevec& payload, const bytevec& aad) { in createECDSACoseSign1Signature()
306 bytevec signatureInput = cppbor::Array() in createECDSACoseSign1Signature()
318 ErrMsgOr<bytevec> createCoseSign1Signature(const bytevec& key, const bytevec& protectedParams, in createCoseSign1Signature()
319 const bytevec& payload, const bytevec& aad) { in createCoseSign1Signature()
320 bytevec signatureInput = cppbor::Array() in createCoseSign1Signature()
328 bytevec signature(ED25519_SIGNATURE_LEN); in createCoseSign1Signature()
336 ErrMsgOr<cppbor::Array> constructECDSACoseSign1(const bytevec& key, cppbor::Map protectedParams, in constructECDSACoseSign1()
337 const bytevec& payload, const bytevec& aad) { in constructECDSACoseSign1()
338 bytevec protParms = protectedParams.add(ALGORITHM, ES256).canonicalize().encode(); in constructECDSACoseSign1()
349 ErrMsgOr<cppbor::Array> constructCoseSign1(const bytevec& key, cppbor::Map protectedParams, in constructCoseSign1()
350 const bytevec& payload, const bytevec& aad) { in constructCoseSign1()
351 bytevec protParms = protectedParams.add(ALGORITHM, EDDSA).canonicalize().encode(); in constructCoseSign1()
362 ErrMsgOr<cppbor::Array> constructCoseSign1(const bytevec& key, const bytevec& payload, in constructCoseSign1()
363 const bytevec& aad) { in constructCoseSign1()
367 ErrMsgOr<bytevec> verifyAndParseCoseSign1(const cppbor::Array* coseSign1, in verifyAndParseCoseSign1()
368 const bytevec& signingCoseKey, const bytevec& aad) { in verifyAndParseCoseSign1()
402 bytevec signatureInput = in verifyAndParseCoseSign1()
457 ErrMsgOr<bytevec> createCoseEncryptCiphertext(const bytevec& key, const bytevec& nonce, in createCoseEncryptCiphertext()
458 const bytevec& protectedParams, in createCoseEncryptCiphertext()
459 const bytevec& plaintextPayload, const bytevec& aad) { in createCoseEncryptCiphertext()
472 ErrMsgOr<cppbor::Array> constructCoseEncrypt(const bytevec& key, const bytevec& nonce, in constructCoseEncrypt()
473 const bytevec& plaintextPayload, const bytevec& aad, in constructCoseEncrypt()
491 ErrMsgOr<std::pair<bytevec /* pubkey */, bytevec /* key ID */>>
544 bytevec publicKey; in getSenderPubKeyFromCoseEncrypt()
572 return std::make_pair(publicKey, bytevec{}); in getSenderPubKeyFromCoseEncrypt()
575 ErrMsgOr<bytevec> decryptCoseEncrypt(const bytevec& key, const cppbor::Item* coseEncrypt, in decryptCoseEncrypt()
576 const bytevec& external_aad) { in decryptCoseEncrypt()
624 ErrMsgOr<bytevec> consructKdfContext(const bytevec& pubKeyA, const bytevec& privKeyA, in consructKdfContext()
625 const bytevec& pubKeyB, bool senderIsA) { in consructKdfContext()
630 bytevec kdfContext = cppbor::Array() in consructKdfContext()
634 .add(bytevec{} /* nonce */) in consructKdfContext()
638 .add(bytevec{} /* nonce */) in consructKdfContext()
642 .add(bytevec{})) // protected in consructKdfContext()
647 ErrMsgOr<bytevec> ECDH_HKDF_DeriveKey(const bytevec& pubKeyA, const bytevec& privKeyA, in ECDH_HKDF_DeriveKey()
648 const bytevec& pubKeyB, bool senderIsA) { in ECDH_HKDF_DeriveKey()
654 bytevec publicKey; in ECDH_HKDF_DeriveKey()
663 bytevec retval(SHA256_DIGEST_LENGTH); in ECDH_HKDF_DeriveKey()
664 bytevec salt{}; in ECDH_HKDF_DeriveKey()
676 ErrMsgOr<bytevec> x25519_HKDF_DeriveKey(const bytevec& pubKeyA, const bytevec& privKeyA, in x25519_HKDF_DeriveKey()
677 const bytevec& pubKeyB, bool senderIsA) { in x25519_HKDF_DeriveKey()
682 bytevec rawSharedKey(X25519_SHARED_KEY_LEN); in x25519_HKDF_DeriveKey()
690 bytevec retval(SHA256_DIGEST_LENGTH); in x25519_HKDF_DeriveKey()
691 bytevec salt{}; in x25519_HKDF_DeriveKey()
703 ErrMsgOr<bytevec> aesGcmEncrypt(const bytevec& key, const bytevec& nonce, const bytevec& aad, in aesGcmEncrypt()
704 const bytevec& plaintext) { in aesGcmEncrypt()
708 bytevec ciphertext(plaintext.size() + kAesGcmTagSize); in aesGcmEncrypt()
729 ErrMsgOr<bytevec> aesGcmDecrypt(const bytevec& key, const bytevec& nonce, const bytevec& aad, in aesGcmDecrypt()
730 const bytevec& ciphertextWithTag) { in aesGcmDecrypt()
736 bytevec plaintext(ciphertextWithTag.size() - kAesGcmTagSize); in aesGcmDecrypt()
744 bytevec tag(ciphertextWithTag.end() - kAesGcmTagSize, ciphertextWithTag.end()); in aesGcmDecrypt()
757 bytevec sha256(const bytevec& data) { in sha256()
758 bytevec ret(SHA256_DIGEST_LENGTH); in sha256()
766 bytevec sha384(const bytevec& data) { in sha384()
767 bytevec ret(SHA384_DIGEST_LENGTH); in sha384()