aboutsummaryrefslogtreecommitdiffstats
path: root/libhashsum_init_sha2_hasher.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--libhashsum_init_sha2_hasher.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libhashsum_init_sha2_hasher.c b/libhashsum_init_sha2_hasher.c
index 9246e48..b76f059 100644
--- a/libhashsum_init_sha2_hasher.c
+++ b/libhashsum_init_sha2_hasher.c
@@ -62,21 +62,27 @@ libhashsum_init_sha2_hasher(struct libhashsum_hasher *this, unsigned algobits, s
if (algobits == 32U && hashbits == 224U) {
this->algorithm = LIBHASHSUM_SHA_224;
algo = LIBSHA2_224;
+ this->algorithm_string = "SHA-224";
} else if (algobits == 32U && hashbits == 256U) {
this->algorithm = LIBHASHSUM_SHA_256;
algo = LIBSHA2_256;
+ this->algorithm_string = "SHA-256";
} else if (algobits == 64U && hashbits == 384U) {
this->algorithm = LIBHASHSUM_SHA_384;
algo = LIBSHA2_384;
+ this->algorithm_string = "SHA-384";
} else if (algobits == 64U && hashbits == 512U) {
this->algorithm = LIBHASHSUM_SHA_512;
algo = LIBSHA2_512;
+ this->algorithm_string = "SHA-512";
} else if (algobits == 64U && hashbits == 224U) {
this->algorithm = LIBHASHSUM_SHA_512_224;
algo = LIBSHA2_512_224;
+ this->algorithm_string = "SHA-512/224";
} else if (algobits == 64U && hashbits == 256U) {
this->algorithm = LIBHASHSUM_SHA_512_256;
algo = LIBSHA2_512_256;
+ this->algorithm_string = "SHA-512/256";
} else {
errno = EINVAL;
return -1;