X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fcrypto_test.cc;h=53451b352360b2d3ec386b97822d9bf214ccbe16;hb=f7b6c0595fe13be3f4a10bcce88dd895b1111b57;hp=e1069b42fa155f63c1a9daffeb9642e3afaad157;hpb=1f389ddcb8e5ae66b5b12afd12da136eff5624d4;p=dcpomatic.git diff --git a/test/crypto_test.cc b/test/crypto_test.cc index e1069b42f..53451b352 100644 --- a/test/crypto_test.cc +++ b/test/crypto_test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2018 Carl Hetherington + Copyright (C) 2018-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,23 +18,26 @@ */ + #include "lib/crypto.h" #include "lib/exceptions.h" #include "test.h" #include #include + using std::string; using std::list; + BOOST_AUTO_TEST_CASE (crypto_test) { - dcp::Data key (dcpomatic::crypto_key_length()); - dcp::Data iv = dcpomatic::random_iv (); + dcp::ArrayData key (dcpomatic::crypto_key_length()); + dcp::ArrayData iv = dcpomatic::random_iv (); - RAND_bytes (key.data().get(), dcpomatic::crypto_key_length()); + RAND_bytes (key.data(), dcpomatic::crypto_key_length()); - dcp::Data ciphertext = dcpomatic::encrypt ("Can you see any fish?", key, iv); + auto ciphertext = dcpomatic::encrypt ("Can you see any fish?", key, iv); BOOST_REQUIRE_EQUAL (dcpomatic::decrypt (ciphertext, key, iv), "Can you see any fish?"); key.data()[5]++;