18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-or-later
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Hash Info: Hash algorithms information
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (c) 2013 Dmitry Kasatkin <d.kasatkin@samsung.com>
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#include <linux/export.h>
98c2ecf20Sopenharmony_ci#include <crypto/hash_info.h>
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ciconst char *const hash_algo_name[HASH_ALGO__LAST] = {
128c2ecf20Sopenharmony_ci	[HASH_ALGO_MD4]		= "md4",
138c2ecf20Sopenharmony_ci	[HASH_ALGO_MD5]		= "md5",
148c2ecf20Sopenharmony_ci	[HASH_ALGO_SHA1]	= "sha1",
158c2ecf20Sopenharmony_ci	[HASH_ALGO_RIPE_MD_160]	= "rmd160",
168c2ecf20Sopenharmony_ci	[HASH_ALGO_SHA256]	= "sha256",
178c2ecf20Sopenharmony_ci	[HASH_ALGO_SHA384]	= "sha384",
188c2ecf20Sopenharmony_ci	[HASH_ALGO_SHA512]	= "sha512",
198c2ecf20Sopenharmony_ci	[HASH_ALGO_SHA224]	= "sha224",
208c2ecf20Sopenharmony_ci	[HASH_ALGO_RIPE_MD_128]	= "rmd128",
218c2ecf20Sopenharmony_ci	[HASH_ALGO_RIPE_MD_256]	= "rmd256",
228c2ecf20Sopenharmony_ci	[HASH_ALGO_RIPE_MD_320]	= "rmd320",
238c2ecf20Sopenharmony_ci	[HASH_ALGO_WP_256]	= "wp256",
248c2ecf20Sopenharmony_ci	[HASH_ALGO_WP_384]	= "wp384",
258c2ecf20Sopenharmony_ci	[HASH_ALGO_WP_512]	= "wp512",
268c2ecf20Sopenharmony_ci	[HASH_ALGO_TGR_128]	= "tgr128",
278c2ecf20Sopenharmony_ci	[HASH_ALGO_TGR_160]	= "tgr160",
288c2ecf20Sopenharmony_ci	[HASH_ALGO_TGR_192]	= "tgr192",
298c2ecf20Sopenharmony_ci	[HASH_ALGO_SM3_256]	= "sm3",
308c2ecf20Sopenharmony_ci	[HASH_ALGO_STREEBOG_256] = "streebog256",
318c2ecf20Sopenharmony_ci	[HASH_ALGO_STREEBOG_512] = "streebog512",
328c2ecf20Sopenharmony_ci};
338c2ecf20Sopenharmony_ciEXPORT_SYMBOL_GPL(hash_algo_name);
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ciconst int hash_digest_size[HASH_ALGO__LAST] = {
368c2ecf20Sopenharmony_ci	[HASH_ALGO_MD4]		= MD5_DIGEST_SIZE,
378c2ecf20Sopenharmony_ci	[HASH_ALGO_MD5]		= MD5_DIGEST_SIZE,
388c2ecf20Sopenharmony_ci	[HASH_ALGO_SHA1]	= SHA1_DIGEST_SIZE,
398c2ecf20Sopenharmony_ci	[HASH_ALGO_RIPE_MD_160]	= RMD160_DIGEST_SIZE,
408c2ecf20Sopenharmony_ci	[HASH_ALGO_SHA256]	= SHA256_DIGEST_SIZE,
418c2ecf20Sopenharmony_ci	[HASH_ALGO_SHA384]	= SHA384_DIGEST_SIZE,
428c2ecf20Sopenharmony_ci	[HASH_ALGO_SHA512]	= SHA512_DIGEST_SIZE,
438c2ecf20Sopenharmony_ci	[HASH_ALGO_SHA224]	= SHA224_DIGEST_SIZE,
448c2ecf20Sopenharmony_ci	[HASH_ALGO_RIPE_MD_128]	= RMD128_DIGEST_SIZE,
458c2ecf20Sopenharmony_ci	[HASH_ALGO_RIPE_MD_256]	= RMD256_DIGEST_SIZE,
468c2ecf20Sopenharmony_ci	[HASH_ALGO_RIPE_MD_320]	= RMD320_DIGEST_SIZE,
478c2ecf20Sopenharmony_ci	[HASH_ALGO_WP_256]	= WP256_DIGEST_SIZE,
488c2ecf20Sopenharmony_ci	[HASH_ALGO_WP_384]	= WP384_DIGEST_SIZE,
498c2ecf20Sopenharmony_ci	[HASH_ALGO_WP_512]	= WP512_DIGEST_SIZE,
508c2ecf20Sopenharmony_ci	[HASH_ALGO_TGR_128]	= TGR128_DIGEST_SIZE,
518c2ecf20Sopenharmony_ci	[HASH_ALGO_TGR_160]	= TGR160_DIGEST_SIZE,
528c2ecf20Sopenharmony_ci	[HASH_ALGO_TGR_192]	= TGR192_DIGEST_SIZE,
538c2ecf20Sopenharmony_ci	[HASH_ALGO_SM3_256]	= SM3256_DIGEST_SIZE,
548c2ecf20Sopenharmony_ci	[HASH_ALGO_STREEBOG_256] = STREEBOG256_DIGEST_SIZE,
558c2ecf20Sopenharmony_ci	[HASH_ALGO_STREEBOG_512] = STREEBOG512_DIGEST_SIZE,
568c2ecf20Sopenharmony_ci};
578c2ecf20Sopenharmony_ciEXPORT_SYMBOL_GPL(hash_digest_size);
58