113#if defined(BOTAN_HAS_COMMONCRYPTO)
127#if defined(BOTAN_HAS_SHA1)
128 if(algo_spec ==
"SHA-1") {
129 return std::make_unique<SHA_1>();
133#if defined(BOTAN_HAS_SHA2_32)
134 if(algo_spec ==
"SHA-224") {
135 return std::make_unique<SHA_224>();
138 if(algo_spec ==
"SHA-256") {
139 return std::make_unique<SHA_256>();
143#if defined(BOTAN_HAS_SHA2_64)
144 if(algo_spec ==
"SHA-384") {
145 return std::make_unique<SHA_384>();
148 if(algo_spec ==
"SHA-512") {
149 return std::make_unique<SHA_512>();
152 if(algo_spec ==
"SHA-512-256") {
153 return std::make_unique<SHA_512_256>();
157#if defined(BOTAN_HAS_RIPEMD_160)
158 if(algo_spec ==
"RIPEMD-160") {
159 return std::make_unique<RIPEMD_160>();
163#if defined(BOTAN_HAS_WHIRLPOOL)
164 if(algo_spec ==
"Whirlpool") {
165 return std::make_unique<Whirlpool>();
169#if defined(BOTAN_HAS_MD5)
170 if(algo_spec ==
"MD5") {
171 return std::make_unique<MD5>();
175#if defined(BOTAN_HAS_MD4)
176 if(algo_spec ==
"MD4") {
177 return std::make_unique<MD4>();
181#if defined(BOTAN_HAS_GOST_34_11)
182 if(algo_spec ==
"GOST-R-34.11-94" || algo_spec ==
"GOST-34.11") {
183 return std::make_unique<GOST_34_11>();
187#if defined(BOTAN_HAS_ADLER32)
188 if(algo_spec ==
"Adler32") {
189 return std::make_unique<Adler32>();
193#if defined(BOTAN_HAS_ASCON_HASH256)
194 if(algo_spec ==
"Ascon-Hash256") {
195 return std::make_unique<Ascon_Hash256>();
199#if defined(BOTAN_HAS_CRC24)
200 if(algo_spec ==
"CRC24") {
201 return std::make_unique<CRC24>();
205#if defined(BOTAN_HAS_CRC32)
206 if(algo_spec ==
"CRC32") {
207 return std::make_unique<CRC32>();
211#if defined(BOTAN_HAS_STREEBOG)
212 if(algo_spec ==
"Streebog-256") {
213 return std::make_unique<Streebog>(256);
215 if(algo_spec ==
"Streebog-512") {
216 return std::make_unique<Streebog>(512);
220#if defined(BOTAN_HAS_SM3)
221 if(algo_spec ==
"SM3") {
222 return std::make_unique<SM3>();
228#if defined(BOTAN_HAS_SKEIN_512)
229 if(
auto m = req.
match(
"Skein-512({bits:int=512},{personalization:str=})")) {
230 return std::make_unique<Skein_512>(m->integer(
"bits"), m->str(
"personalization"));
234#if defined(BOTAN_HAS_BLAKE2B)
235 if(
auto m = req.
match(
"BLAKE2b|Blake2b({bits:int=512})")) {
236 return std::make_unique<BLAKE2b>(m->integer(
"bits"));
240#if defined(BOTAN_HAS_BLAKE2S)
241 if(
auto m = req.
match(
"BLAKE2s|Blake2s({bits:int=256})")) {
242 return std::make_unique<BLAKE2s>(m->integer(
"bits"));
246#if defined(BOTAN_HAS_KECCAK)
247 if(
auto m = req.
match(
"Keccak-1600({bits:int=512})")) {
248 return std::make_unique<Keccak_1600>(m->integer(
"bits"));
252#if defined(BOTAN_HAS_SHA3)
253 if(
auto m = req.
match(
"SHA-3({bits:int=512})")) {
254 return std::make_unique<SHA_3>(m->integer(
"bits"));
258#if defined(BOTAN_HAS_SHAKE)
259 if(
auto m = req.
match(
"SHAKE-128({bits:int})")) {
260 return std::make_unique<SHAKE_128>(m->integer(
"bits"));
262 if(
auto m = req.
match(
"SHAKE-256({bits:int})")) {
263 return std::make_unique<SHAKE_256>(m->integer(
"bits"));
267#if defined(BOTAN_HAS_PARALLEL_HASH)
268 if(
auto m = req.
match(
"Parallel({hash}...)")) {
269 std::vector<std::unique_ptr<HashFunction>> hashes;
271 for(
const auto& hash_spec : m->rest(
"hash")) {
276 hashes.push_back(std::move(h));
279 return std::make_unique<Parallel>(hashes);
283#if defined(BOTAN_HAS_TRUNCATED_HASH)
284 if(
auto m = req.
match(
"Truncated({hash},{bits:int})")) {
290 return std::make_unique<Truncated_Hash>(std::move(hash), m->integer(
"bits"));
294#if defined(BOTAN_HAS_COMB4P)
295 if(
auto m = req.
match(
"Comb4P({hash1},{hash2})")) {
300 return std::make_unique<Comb4P>(std::move(h1), std::move(h2));