Remco Bloemen
/
EntropySource
Use your mbed and it\'s noisy analog inputs as a hardware random number generator!
Embed:
(wiki syntax)
Show/hide line numbers
EntropyPool.h
00001 #pragma once 00002 #include <SHA256.h> 00003 #include "mbed.h" 00004 00005 class EntropyPool: protected SHA256 { 00006 public: 00007 EntropyPool(); 00008 00009 int entropy() { return e; } 00010 00011 void gather(); 00012 00013 void gatherAnalogNoise(AnalogIn& input, int entropy = 8); 00014 00015 char* produce(int bytes); 00016 00017 FunctionPointer gatherer; 00018 00019 protected: 00020 Timer timer; 00021 int e; 00022 };
Generated on Fri Jul 15 2022 02:04:55 by 1.7.2