Lines Matching refs:GCM_NONCE_BYTES
58 static constexpr size_t GCM_NONCE_BYTES = 12; variable
210 if (!checkSize("nonce", nonce.size(), GCM_NONCE_BYTES)) return false; in encryptWithKeymasterKey()
224 auto nonce = ciphertext.substr(0, GCM_NONCE_BYTES); in decryptWithKeymasterKey()
225 auto bodyAndMac = ciphertext.substr(GCM_NONCE_BYTES); in decryptWithKeymasterKey()
311 if (!readRandomBytesOrLog(GCM_NONCE_BYTES, ciphertext)) return false; in encryptWithoutKeymaster()
324 ciphertext->resize(GCM_NONCE_BYTES + plaintext.size() + GCM_MAC_BYTES); in encryptWithoutKeymaster()
327 reinterpret_cast<uint8_t*>(&(*ciphertext)[0] + GCM_NONCE_BYTES), &outlen, in encryptWithoutKeymaster()
337 … reinterpret_cast<uint8_t*>(&(*ciphertext)[0] + GCM_NONCE_BYTES + plaintext.size()), &outlen)) { in encryptWithoutKeymaster()
346 reinterpret_cast<uint8_t*>(&(*ciphertext)[0] + GCM_NONCE_BYTES + plaintext.size()))) { in encryptWithoutKeymaster()
355 if (ciphertext.size() < GCM_NONCE_BYTES + GCM_MAC_BYTES) { in decryptWithoutKeymaster()
373 plaintext->resize(ciphertext.size() - GCM_NONCE_BYTES - GCM_MAC_BYTES); in decryptWithoutKeymaster()
377 reinterpret_cast<const uint8_t*>(ciphertext.data() + GCM_NONCE_BYTES), plaintext->size())) { in decryptWithoutKeymaster()
387 … reinterpret_cast<const void*>(ciphertext.data() + GCM_NONCE_BYTES + plaintext->size())))) { in decryptWithoutKeymaster()