diff options
| author | John Hurst <jhurst@cinecert.com> | 2021-02-12 08:24:11 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-12 08:24:11 -0800 |
| commit | fc2f92cb883da9f5bd94a50033c2e99e141653a1 (patch) | |
| tree | 32592b449be218bbf41efbc1afbd82a8f6cae3d7 /src/asdcp-util.cpp | |
| parent | 15d1d022d02d8782379dafac81fb51a9e6f5a157 (diff) | |
| parent | b5e47e45509ce3a1a696ef06583ef86a5e1e8223 (diff) | |
Merge pull request #70 from cinecert/sha1_builtin
Sha1 builtin
Diffstat (limited to 'src/asdcp-util.cpp')
| -rwxr-xr-x | src/asdcp-util.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/asdcp-util.cpp b/src/asdcp-util.cpp index a3c891d..d93465c 100755 --- a/src/asdcp-util.cpp +++ b/src/asdcp-util.cpp @@ -35,8 +35,8 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <KM_fileio.h> #include <KM_prng.h> +#include <KM_sha1.h> #include <AS_DCP.h> -#include <openssl/sha.h> using namespace Kumu; @@ -182,7 +182,7 @@ Result_t digest_file(const std::string& filename) { FileReader Reader; - SHA_CTX Ctx; + SHA1_CTX Ctx; SHA1_Init(&Ctx); ByteString Buf(8192); @@ -244,17 +244,15 @@ main(int argc, const char** argv) if ( Options.mode == MMT_GEN_KEY ) { - Kumu::FortunaRNG RNG; - byte_t bin_buf[ASDCP::KeyLen]; - - RNG.FillRandom(bin_buf, ASDCP::KeyLen); - printf("%s\n", Kumu::bin2hex(bin_buf, ASDCP::KeyLen, str_buf, 64)); + SymmetricKey key_value; + Kumu::GenRandomValue(key_value); + printf("%s\n", key_value.EncodeHex(str_buf, 64)); } else if ( Options.mode == MMT_GEN_ID ) { - UUID TmpID; - Kumu::GenRandomValue(TmpID); - printf("%s\n", TmpID.EncodeHex(str_buf, 64)); + UUID id_value; + Kumu::GenRandomValue(id_value); + printf("%s\n", id_value.EncodeHex(str_buf, 64)); } else if ( Options.mode == MMT_DIGEST ) { |
