Back to home page

LXR

 
 

    


0001 /*
0002  * Hash Info: Hash algorithms information
0003  *
0004  * Copyright (c) 2013 Dmitry Kasatkin <d.kasatkin@samsung.com>
0005  *
0006  * This program is free software; you can redistribute it and/or modify it
0007  * under the terms of the GNU General Public License as published by the Free
0008  * Software Foundation; either version 2 of the License, or (at your option)
0009  * any later version.
0010  *
0011  */
0012 
0013 #include <linux/export.h>
0014 #include <crypto/hash_info.h>
0015 
0016 const char *const hash_algo_name[HASH_ALGO__LAST] = {
0017     [HASH_ALGO_MD4]     = "md4",
0018     [HASH_ALGO_MD5]     = "md5",
0019     [HASH_ALGO_SHA1]    = "sha1",
0020     [HASH_ALGO_RIPE_MD_160] = "rmd160",
0021     [HASH_ALGO_SHA256]  = "sha256",
0022     [HASH_ALGO_SHA384]  = "sha384",
0023     [HASH_ALGO_SHA512]  = "sha512",
0024     [HASH_ALGO_SHA224]  = "sha224",
0025     [HASH_ALGO_RIPE_MD_128] = "rmd128",
0026     [HASH_ALGO_RIPE_MD_256] = "rmd256",
0027     [HASH_ALGO_RIPE_MD_320] = "rmd320",
0028     [HASH_ALGO_WP_256]  = "wp256",
0029     [HASH_ALGO_WP_384]  = "wp384",
0030     [HASH_ALGO_WP_512]  = "wp512",
0031     [HASH_ALGO_TGR_128] = "tgr128",
0032     [HASH_ALGO_TGR_160] = "tgr160",
0033     [HASH_ALGO_TGR_192] = "tgr192",
0034     [HASH_ALGO_SM3_256] = "sm3-256",
0035 };
0036 EXPORT_SYMBOL_GPL(hash_algo_name);
0037 
0038 const int hash_digest_size[HASH_ALGO__LAST] = {
0039     [HASH_ALGO_MD4]     = MD5_DIGEST_SIZE,
0040     [HASH_ALGO_MD5]     = MD5_DIGEST_SIZE,
0041     [HASH_ALGO_SHA1]    = SHA1_DIGEST_SIZE,
0042     [HASH_ALGO_RIPE_MD_160] = RMD160_DIGEST_SIZE,
0043     [HASH_ALGO_SHA256]  = SHA256_DIGEST_SIZE,
0044     [HASH_ALGO_SHA384]  = SHA384_DIGEST_SIZE,
0045     [HASH_ALGO_SHA512]  = SHA512_DIGEST_SIZE,
0046     [HASH_ALGO_SHA224]  = SHA224_DIGEST_SIZE,
0047     [HASH_ALGO_RIPE_MD_128] = RMD128_DIGEST_SIZE,
0048     [HASH_ALGO_RIPE_MD_256] = RMD256_DIGEST_SIZE,
0049     [HASH_ALGO_RIPE_MD_320] = RMD320_DIGEST_SIZE,
0050     [HASH_ALGO_WP_256]  = WP256_DIGEST_SIZE,
0051     [HASH_ALGO_WP_384]  = WP384_DIGEST_SIZE,
0052     [HASH_ALGO_WP_512]  = WP512_DIGEST_SIZE,
0053     [HASH_ALGO_TGR_128] = TGR128_DIGEST_SIZE,
0054     [HASH_ALGO_TGR_160] = TGR160_DIGEST_SIZE,
0055     [HASH_ALGO_TGR_192] = TGR192_DIGEST_SIZE,
0056     [HASH_ALGO_SM3_256] = SM3256_DIGEST_SIZE,
0057 };
0058 EXPORT_SYMBOL_GPL(hash_digest_size);