Lines Matching refs:ciphertext
225 auto ciphertext = aesGcmEncrypt(key, nonce, in createCoseEncryptCiphertext() local
233 if (!ciphertext) return ciphertext.moveMessage(); in createCoseEncryptCiphertext()
234 return ciphertext.moveValue(); in createCoseEncryptCiphertext()
245 auto ciphertext = in constructCoseEncrypt() local
247 if (!ciphertext) return ciphertext.moveMessage(); in constructCoseEncrypt()
252 .add(*ciphertext) // Payload in constructCoseEncrypt()
273 auto& ciphertext = recipient->asArray()->get(2); in getSenderPubKeyFromCoseEncrypt() local
274 if (!ciphertext->asSimple() || !ciphertext->asSimple()->asNull()) { in getSenderPubKeyFromCoseEncrypt()
276 cppbor::prettyPrint(ciphertext.get()); in getSenderPubKeyFromCoseEncrypt()
330 auto& ciphertext = coseEncrypt->asArray()->get(kCoseEncryptPayload); in decryptCoseEncrypt() local
333 if (!protParms || !protParms->asBstr() || !unprotParms || !ciphertext || !recipients) { in decryptCoseEncrypt()
359 if (!ciphertext->asBstr()) return "Invalid ciphertext"; in decryptCoseEncrypt()
367 return aesGcmDecrypt(key, nonce->asBstr()->value(), aad, ciphertext->asBstr()->value()); in decryptCoseEncrypt()
414 bytevec ciphertext(plaintext.size() + kAesGcmTagSize); in aesGcmEncrypt() local
416 if (!EVP_CipherUpdate(ctx->get(), ciphertext.data(), &outlen, plaintext.data(), in aesGcmEncrypt()
422 if (!EVP_CipherFinal_ex(ctx->get(), ciphertext.data() + outlen, &outlen)) { in aesGcmEncrypt()
428 ciphertext.data() + plaintext.size())) { in aesGcmEncrypt()
432 return ciphertext; in aesGcmEncrypt()