From 1ea0b1d9ff98d8c44658046019c94f5952ad5c66 Mon Sep 17 00:00:00 2001 From: Oliver Reiche Date: Tue, 14 Jun 2022 18:41:53 +0200 Subject: Crypto: Add and use set of globally used hash functions --- src/buildtool/main/main.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/buildtool/main/main.cpp') diff --git a/src/buildtool/main/main.cpp b/src/buildtool/main/main.cpp index 4f074eb4..ba8bcb7d 100644 --- a/src/buildtool/main/main.cpp +++ b/src/buildtool/main/main.cpp @@ -249,13 +249,10 @@ void SetupExecutionConfig(EndpointArguments const& eargs, } } -void SetupHashGenerator() { - if (Compatibility::IsCompatible()) { - HashGenerator::SetHashGenerator(HashGenerator::HashType::SHA256); - } - else { - HashGenerator::SetHashGenerator(HashGenerator::HashType::GIT); - } +void SetupHashFunction() { + HashFunction::SetHashType(Compatibility::IsCompatible() + ? HashFunction::JustHash::Compatible + : HashFunction::JustHash::Native); } #endif @@ -1324,7 +1321,7 @@ auto main(int argc, char* argv[]) -> int { SetupLogging(arguments.common); #ifndef BOOTSTRAP_BUILD_TOOL - SetupHashGenerator(); + SetupHashFunction(); SetupExecutionConfig( arguments.endpoint, arguments.build, arguments.rebuild); #endif -- cgit v1.2.3