|
|
1.1 ! root 1: // ! 2: // nono ! 3: // Copyright (C) 2024 nono project ! 4: // Licensed under nono-license.txt ! 5: // ! 6: ! 7: // ! 8: // VirtIO エントロピーデバイス ! 9: // ! 10: ! 11: #pragma once ! 12: ! 13: #include "virtio_base.h" ! 14: #include "monitor.h" ! 15: #include <random> ! 16: ! 17: class VirtIOEntropyDevice : public VirtIODevice ! 18: { ! 19: using inherited = VirtIODevice; ! 20: ! 21: public: ! 22: explicit VirtIOEntropyDevice(uint slot_); ! 23: ~VirtIOEntropyDevice() override; ! 24: ! 25: private: ! 26: DECLARE_MONITOR_CALLBACK(MonitorUpdate); ! 27: ! 28: // ディスクリプタを一つ処理する。 ! 29: void ProcessDesc(VirtIOReq&) override; ! 30: ! 31: // デフォルトコンストラクタは実質 /dev/urandom だが ! 32: // こいつにはこれ以上安全な指定方法がない。 ! 33: std::random_device rnd {}; ! 34: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.