Migrate entropy testing to opaque.

This commit is contained in:
Matthias Vallentin 2012-12-13 19:18:47 -08:00
parent 86faab1e06
commit b9d05f56d0
7 changed files with 156 additions and 87 deletions

View file

@ -1,6 +1,7 @@
#ifndef OPAQUEVAL_H
#define OPAQUEVAL_H
#include "RandTest.h"
#include "Val.h"
#include "digest.h"
@ -86,4 +87,22 @@ private:
SHA256_CTX ctx;
};
class EntropyVal : public OpaqueVal {
public:
EntropyVal() : OpaqueVal(new OpaqueType("entropy")) { }
bool Feed(const void* data, size_t size);
bool Get(double *r_ent, double *r_chisq, double *r_mean,
double *r_montepicalc, double *r_scc);
protected:
friend class Val;
EntropyVal(OpaqueType* t);
DECLARE_SERIAL(EntropyVal);
private:
RandTest state;
};
#endif