aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/entropy/darwin_secrandom/darwin_secrandom.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/entropy/darwin_secrandom/darwin_secrandom.h')
-rw-r--r--src/lib/entropy/darwin_secrandom/darwin_secrandom.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/lib/entropy/darwin_secrandom/darwin_secrandom.h b/src/lib/entropy/darwin_secrandom/darwin_secrandom.h
new file mode 100644
index 000000000..504d5cc64
--- /dev/null
+++ b/src/lib/entropy/darwin_secrandom/darwin_secrandom.h
@@ -0,0 +1,31 @@
+/*
+* Darwin SecRandomCopyBytes EntropySource
+* (C) 2015 Daniel Seither (Kullo GmbH)
+*
+* Botan is released under the Simplified BSD License (see license.txt)
+*/
+
+#ifndef BOTAN_ENTROPY_SRC_DARWIN_SECRANDOM_H__
+#define BOTAN_ENTROPY_SRC_DARWIN_SECRANDOM_H__
+
+#include <botan/entropy_src.h>
+
+namespace Botan {
+
+/**
+* Entropy source using SecRandomCopyBytes from Darwin's Security.framework
+*/
+class Darwin_SecRandom : public EntropySource
+ {
+ public:
+ std::string name() const override { return "Darwin SecRandomCopyBytes"; }
+
+ void poll(Entropy_Accumulator& accum) override;
+
+ private:
+ secure_vector<byte> m_buf;
+ };
+
+}
+
+#endif