blob: 311f45fc5e4ad53229b1e618e0f06e0341317b59 [file] [log] [blame]
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef PERIDOT_LIB_RNG_SYSTEM_RANDOM_H_
#define PERIDOT_LIB_RNG_SYSTEM_RANDOM_H_
#include "peridot/lib/rng/random.h"
#include <zircon/syscalls.h>
namespace rng {
// Implementation of |Random| that uses the system RNG.
class SystemRandom final : public Random {
private:
void InternalDraw(void* buffer, size_t buffer_size) override {
zx_cprng_draw(buffer, buffer_size);
}
};
} // namespace rng
#endif // PERIDOT_LIB_RNG_SYSTEM_RANDOM_H_