Lines Matching refs:plaintext
346 static bool encryptWithoutKeymaster(const std::string& preKey, const KeyBuffer& plaintext, in encryptWithoutKeymaster() argument
364 ciphertext->resize(GCM_NONCE_BYTES + plaintext.size() + GCM_MAC_BYTES); in encryptWithoutKeymaster()
368 &outlen, reinterpret_cast<const uint8_t*>(plaintext.data()), plaintext.size())) { in encryptWithoutKeymaster()
372 if (outlen != static_cast<int>(plaintext.size())) { in encryptWithoutKeymaster()
373 LOG(ERROR) << "GCM ciphertext length should be " << plaintext.size() << " was " << outlen; in encryptWithoutKeymaster()
378 reinterpret_cast<uint8_t*>(&(*ciphertext)[0] + GCM_NONCE_BYTES + plaintext.size()), in encryptWithoutKeymaster()
389 plaintext.size()))) { in encryptWithoutKeymaster()
397 KeyBuffer* plaintext) { in decryptWithoutKeymaster() argument
417 *plaintext = KeyBuffer(ciphertext.size() - GCM_NONCE_BYTES - GCM_MAC_BYTES); in decryptWithoutKeymaster()
419 if (1 != EVP_DecryptUpdate(ctx.get(), reinterpret_cast<uint8_t*>(&(*plaintext)[0]), &outlen, in decryptWithoutKeymaster()
421 plaintext->size())) { in decryptWithoutKeymaster()
425 if (outlen != static_cast<int>(plaintext->size())) { in decryptWithoutKeymaster()
426 LOG(ERROR) << "GCM plaintext length should be " << plaintext->size() << " was " << outlen; in decryptWithoutKeymaster()
431 ciphertext.data() + GCM_NONCE_BYTES + plaintext->size())))) { in decryptWithoutKeymaster()
436 reinterpret_cast<uint8_t*>(&(*plaintext)[0] + plaintext->size()), in decryptWithoutKeymaster()