summaryrefslogtreecommitdiff
path: root/asdcplib/src/KM_prng.cpp
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-01-05 15:32:10 +0000
committerCarl Hetherington <cth@carlh.net>2016-01-05 15:32:10 +0000
commit3ec4338ce90ea0549409312f24f8b28c07a5d2da (patch)
tree09aaaff66dd860abbeacc20793145e1a27f4defd /asdcplib/src/KM_prng.cpp
parent342aad2ddf893aaaafa9a2c9980579d2dc4ec125 (diff)
asdcplib 2.5.11
Diffstat (limited to 'asdcplib/src/KM_prng.cpp')
-rwxr-xr-xasdcplib/src/KM_prng.cpp35
1 files changed, 1 insertions, 34 deletions
diff --git a/asdcplib/src/KM_prng.cpp b/asdcplib/src/KM_prng.cpp
index 463ae157..5212595f 100755
--- a/asdcplib/src/KM_prng.cpp
+++ b/asdcplib/src/KM_prng.cpp
@@ -1,5 +1,3 @@
-/* -*- c-basic-offset: 2; -*- */
-
/*
Copyright (c) 2006-2009, John Hurst
All rights reserved.
@@ -50,6 +48,7 @@ using namespace Kumu;
const char* DEV_URANDOM = "/dev/urandom";
#endif // KM_WIN32
+
const ui32_t RNG_KEY_SIZE = 512UL;
const ui32_t RNG_KEY_SIZE_BITS = 256UL;
const ui32_t RNG_BLOCK_SIZE = 16UL;
@@ -65,7 +64,6 @@ public:
AES_KEY m_Context;
byte_t m_ctr_buf[RNG_BLOCK_SIZE];
Mutex m_Lock;
- unsigned int m_libdcp_test_rng_state;
h__RNG()
{
@@ -99,10 +97,6 @@ public:
} // end AutoMutex context
set_key(rng_key);
-
-#ifdef LIBDCP_POSIX
- reset();
-#endif
}
//
@@ -144,26 +138,7 @@ public:
AES_encrypt(m_ctr_buf, tmp, &m_Context);
memcpy(buf + gen_count, tmp, len - gen_count);
}
-
-#ifdef LIBDCP_POSIX
- if (libdcp_test)
- {
- for (unsigned int i = 0; i < len; ++i)
- buf[i] = rand_r(&m_libdcp_test_rng_state);
- }
-#endif
-
-#ifdef LIBDCP_WINDOWS
- /* XXX */
-#endif
}
-
-#ifdef LIBDCP_POSIX
- void reset ()
- {
- m_libdcp_test_rng_state = 1;
- }
-#endif
};
@@ -217,14 +192,6 @@ Kumu::FortunaRNG::FillRandom(Kumu::ByteString& Buffer)
return Buffer.Data();
}
-#ifdef LIBDCP_POSIX
-void
-Kumu::FortunaRNG::Reset()
-{
- s_RNG->reset();
-}
-#endif
-
//------------------------------------------------------------------------------------------
//