MCPcopy Create free account
hub / github.com/apache/arrow / MakeEncryptionKey

Function MakeEncryptionKey

cpp/src/parquet/arrow/fuzz_internal.cc:60–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58} // namespace
59
60EncryptionKey MakeEncryptionKey(int key_len) {
61 // Keep the engine persistent to generate a different key every time
62 static auto gen = []() { return std::default_random_engine(/*seed=*/42); }();
63
64 std::uniform_int_distribution<unsigned int> chars_dist(0, 255);
65 std::string key(key_len, '\x00');
66 for (auto& c : key) {
67 c = static_cast<uint8_t>(chars_dist(gen));
68 }
69
70 std::string key_metadata(kInlineKeyPrefix);
71 key_metadata += ::arrow::util::base64_encode(key);
72
73 return {SecureString(std::move(key)), std::move(key_metadata)};
74}
75
76class FuzzDecryptionKeyRetriever : public DecryptionKeyRetriever {
77 public:

Callers 1

Calls 1

SecureStringFunction · 0.85

Tested by

no test coverage detected