Lines Matching refs:data
84 const std::vector<uint8_t>& data) { in coseBuildToBeSigned() argument
92 enc.encodeBstr(data); in coseBuildToBeSigned()
101 if (RAND_bytes(output.data(), numBytes) != 1) { in getRandom()
116 for (auto data : data_list) { in sha() local
117 SHA384_Update(&ctx, std::get<0>(data), std::get<1>(data)); in sha()
120 SHA384_Final((unsigned char*)ret.data(), &ctx); in sha()
132 for (auto data : data_list) { in sha() local
133 SHA256_Update(&ctx, std::get<0>(data), std::get<1>(data)); in sha()
136 SHA256_Final((unsigned char*)ret.data(), &ctx); in sha()
142 static SHADigest sha(const std::vector<uint8_t>& data) { in sha() argument
143 return sha({{data.data(), data.size()}}); in sha()
149 const unsigned char* k = key.data(); in signEcDsaDigest()
169 ECDSA_do_sign(dataDigest.data(), dataDigest.size(), ecKey.get()), in signEcDsaDigest()
178 unsigned char* p = (unsigned char*)signature.data(); in signEcDsaDigest()
185 const std::vector<uint8_t>& data) { in signEcDsa() argument
186 return signEcDsaDigest(key, sha(data)); in signEcDsa()
192 const unsigned char* p = ecdsaDerSignature.data(); in ecdsaSignatureDerToCose()
227 if (BN_bn2bin(rBn, ecdsaCoseSignature.data() + kEcdsaValueSize - rBnSize) != in ecdsaSignatureDerToCose()
232 if (BN_bn2bin(sBn, ecdsaCoseSignature.data() + kEcdsaSignatureSize - in ecdsaSignatureDerToCose()
243 const std::vector<uint8_t>& data, in coseSignEcDsa() argument
262 coseBuildToBeSigned(encodedProtectedHeaders, data); in coseSignEcDsa()
289 enc.encodeBstr(data); in coseSignEcDsa()
307 bool coseIsSigned(CoseByteView data, size_t* signatureLength) { in coseIsSigned() argument
311 CborInInit(data.data(), data.size(), &in); in coseIsSigned()
370 int rc = ECDSA_do_verify(digest.data(), digest.size(), sig.get(), in checkEcDsaSignature()
384 CborInInit(signatureCoseSign1.data(), signatureCoseSign1.size(), &in); in coseCheckEcDsaSignature()
438 std::vector<uint8_t> data(dataPtr, dataPtr + dataSize); in coseCheckEcDsaSignature() local
440 if (data.size() > 0 && detachedContent.size() > 0) { in coseCheckEcDsaSignature()
462 auto& signaturePayload = data.size() > 0 ? data : detachedContent; in coseCheckEcDsaSignature()
467 publicKey.data(), publicKey.size())) { in coseCheckEcDsaSignature()
694 const CoseByteView& data, in encryptAesGcm() argument
709 encryptedData.resize(data.size() + kAesGcmTagSize); in encryptAesGcm()
710 unsigned char* ciphertext = (unsigned char*)encryptedData.data(); in encryptAesGcm()
711 unsigned char* tag = ciphertext + data.size(); in encryptAesGcm()
736 if (EVP_EncryptInit_ex(ctx.get(), NULL, NULL, key.data(), nonce.data()) != in encryptAesGcm()
746 additionalAuthenticatedData.data(), in encryptAesGcm()
770 if (data.size() > 0) { in encryptAesGcm()
771 if (EVP_EncryptUpdate(ctx.get(), ciphertext, &numWritten, data.data(), in encryptAesGcm()
772 data.size()) != 1) { in encryptAesGcm()
778 static_cast<size_t>(data.size())) { in encryptAesGcm()
781 numWritten, data.size()); in encryptAesGcm()
814 const CoseByteView& data, in coseEncryptAesGcm() argument
838 std::span encodedProtectedHeadersView(encodedProtectedHeaders.data(), in coseEncryptAesGcm()
846 encryptAesGcm(key, iv.value(), data, gcmAadView); in coseEncryptAesGcm()
868 const CoseByteView& data, in coseEncryptAesGcmKeyWrap() argument
919 COSE_CONTEXT_ENCRYPT, std::move(contentEncryptionKey.value()), data, in coseEncryptAesGcmKeyWrap()
993 if (EVP_DecryptInit_ex(ctx.get(), NULL, NULL, key.data(), nonce.data()) != in decryptAesGcmInPlace()
1003 additionalAuthenticatedData.data(), in decryptAesGcmInPlace()
1072 CborInInit(item.data(), item.size(), &in); in coseDecryptAesGcmInPlace()
1222 CborInInit(cose_encrypt.data(), cose_encrypt.size(), &in); in coseDecryptAesGcmKeyWrapInPlace()
1340 CoseByteView recipient(cose_encrypt.data() + recipientOffset, in coseDecryptAesGcmKeyWrapInPlace()