aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/crypto/random.h
blob: a5bb62b92648a7d2e2a92627aaf6a6ecb0eb564f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include <cstddef>

namespace vespalib::crypto {

// Fills `buf` with `len` bytes of cryptographically secure pseudo-random data.
// Aborts the process if CSPRNG somehow fails.
void random_buffer(unsigned char* buf, size_t len) noexcept;

}