aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/crypto/random.h
blob: e20d6dcdf24f81411c76db3bef3c2374b985be4b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
// Copyright Vespa.ai. 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;

}