MCPcopy Create free account
hub / github.com/apple/foundationdb / EncryptionStreamCipher

Method EncryptionStreamCipher

flow/StreamCipher.cpp:126–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124}
125
126EncryptionStreamCipher::EncryptionStreamCipher(const StreamCipherKey* key, const StreamCipher::IV& iv)
127 : cipher(StreamCipher(key->size())) {
128 EVP_EncryptInit_ex(cipher.getCtx(), EVP_aes_256_gcm(), nullptr, nullptr, nullptr);
129 EVP_CIPHER_CTX_ctrl(cipher.getCtx(), EVP_CTRL_AEAD_SET_IVLEN, iv.size(), nullptr);
130 EVP_EncryptInit_ex(cipher.getCtx(), nullptr, nullptr, key->data(), iv.data());
131}
132
133StringRef EncryptionStreamCipher::encrypt(unsigned char const* plaintext, int len, Arena& arena) {
134 CODE_PROBE(true, "Encrypting data with StreamCipher");

Callers

nothing calls this directly

Calls 4

StreamCipherClass · 0.85
sizeMethod · 0.45
getCtxMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected