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

Method encrypt

flow/StreamCipher.cpp:133–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131}
132
133StringRef EncryptionStreamCipher::encrypt(unsigned char const* plaintext, int len, Arena& arena) {
134 CODE_PROBE(true, "Encrypting data with StreamCipher");
135 auto ciphertext = new (arena) unsigned char[len + AES_BLOCK_SIZE];
136 int bytes{ 0 };
137 EVP_EncryptUpdate(cipher.getCtx(), ciphertext, &bytes, plaintext, len);
138 return StringRef(ciphertext, bytes);
139}
140
141StringRef EncryptionStreamCipher::finish(Arena& arena) {
142 auto ciphertext = new (arena) unsigned char[AES_BLOCK_SIZE];

Callers 1

StreamCipher.cppFile · 0.45

Calls 2

StringRefClass · 0.50
getCtxMethod · 0.45

Tested by

no test coverage detected