• Home
  • Raw
  • Download

Lines Matching refs:ciphertext

380                                     const KeyBuffer& message, std::string* ciphertext) {  in encryptWithKeymasterKey()  argument
402 *ciphertext = nonce + body + mac; in encryptWithKeymasterKey()
408 const std::string& ciphertext, KeyBuffer* message) { in decryptWithKeymasterKey() argument
409 const std::string nonce = ciphertext.substr(0, GCM_NONCE_BYTES); in decryptWithKeymasterKey()
410 auto bodyAndMac = ciphertext.substr(GCM_NONCE_BYTES); in decryptWithKeymasterKey()
474 std::string* ciphertext) { in encryptWithoutKeymaster() argument
478 if (!readRandomBytesOrLog(GCM_NONCE_BYTES, ciphertext)) return false; in encryptWithoutKeymaster()
487 reinterpret_cast<const uint8_t*>(ciphertext->data()))) { in encryptWithoutKeymaster()
491 ciphertext->resize(GCM_NONCE_BYTES + plaintext.size() + GCM_MAC_BYTES); in encryptWithoutKeymaster()
494 ctx.get(), reinterpret_cast<uint8_t*>(&(*ciphertext)[0] + GCM_NONCE_BYTES), in encryptWithoutKeymaster()
505 reinterpret_cast<uint8_t*>(&(*ciphertext)[0] + GCM_NONCE_BYTES + plaintext.size()), in encryptWithoutKeymaster()
515 reinterpret_cast<uint8_t*>(&(*ciphertext)[0] + GCM_NONCE_BYTES + in encryptWithoutKeymaster()
523 static bool decryptWithoutKeymaster(const std::string& preKey, const std::string& ciphertext, in decryptWithoutKeymaster() argument
525 if (ciphertext.size() < GCM_NONCE_BYTES + GCM_MAC_BYTES) { in decryptWithoutKeymaster()
526 LOG(ERROR) << "GCM ciphertext too small: " << ciphertext.size(); in decryptWithoutKeymaster()
540 reinterpret_cast<const uint8_t*>(ciphertext.data()))) { in decryptWithoutKeymaster()
544 *plaintext = KeyBuffer(ciphertext.size() - GCM_NONCE_BYTES - GCM_MAC_BYTES); in decryptWithoutKeymaster()
547 … reinterpret_cast<const uint8_t*>(ciphertext.data() + GCM_NONCE_BYTES), in decryptWithoutKeymaster()
558 ciphertext.data() + GCM_NONCE_BYTES + plaintext->size())))) { in decryptWithoutKeymaster()