#include <openssl/aes.h>
#include <openssl/sha.h>
#include <openssl/bn.h>
-
+#ifdef LIBDCP_VALGRIND
+#include <valgrind/memcheck.h>
+#endif
+
using namespace Kumu;
SHA1_Update(&SHA, key_fodder, RNG_KEY_SIZE);
SHA1_Final(sha_buf, &SHA);
+#ifdef LIBDCP_VALGRIND
+ VALGRIND_MAKE_MEM_DEFINED (sha_buf, 20);
+#endif
+
AutoMutex Lock(m_Lock);
AES_set_encrypt_key(sha_buf, RNG_KEY_SIZE_BITS, &m_Context);
*(ui32_t*)(m_ctr_buf + 12) = 1;
opt.add_option('--osx', action='store_true', default=False, help='set up to build on OS X')
opt.add_option('--enable-debug', action='store_true', default=False, help='build with debugging information and without optimisation')
opt.add_option('--static', action='store_true', default=False, help='build libdcp and in-tree dependencies statically, and link statically to openjpeg and cxml')
+ opt.add_option('--valgrind', action='store_true', default=False, help='build with instructions to Valgrind to reduce false positives')
def configure(conf):
conf.load('compiler_cxx')
else:
conf.env.append_value('CXXFLAGS', '-DLIBDCP_POSIX')
+ if conf.options.valgrind:
+ conf.env.append_value('CXXFLAGS', '-DLIBDCP_VALGRIND')
+
if not conf.options.osx:
conf.env.append_value('CXXFLAGS', ['-Wno-unused-result', '-Wno-unused-parameter'])