From: Aki Tuomi Date: Thu, 3 Dec 2020 14:24:52 +0000 (+0200) Subject: lib: hash-method - Use named initializers X-Git-Tag: 2.3.14.rc1~240 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d111a18e6c1699d00ace50b86947c7db327da91f;p=thirdparty%2Fdovecot%2Fcore.git lib: hash-method - Use named initializers --- diff --git a/src/lib/hash-method.c b/src/lib/hash-method.c index c5e55023a5..a32e995141 100644 --- a/src/lib/hash-method.c +++ b/src/lib/hash-method.c @@ -74,13 +74,13 @@ buffer_t *t_hash_data(const struct hash_method *meth, } static const struct hash_method hash_method_size = { - "size", - sizeof(uint64_t), - sizeof(uint64_t), + .name = "size", + .context_size = sizeof(uint64_t), + .digest_size = sizeof(uint64_t), - hash_method_init_size, - hash_method_loop_size, - hash_method_result_size + .init = hash_method_init_size, + .loop = hash_method_loop_size, + .result = hash_method_result_size }; const struct hash_method *hash_methods[] = { diff --git a/src/lib/md4.c b/src/lib/md4.c index 87228505b7..ced55feb2a 100644 --- a/src/lib/md4.c +++ b/src/lib/md4.c @@ -289,11 +289,11 @@ static void hash_method_result_md4(void *context, unsigned char *result_r) } const struct hash_method hash_method_md4 = { - "md4", - sizeof(struct md4_context), - MD4_RESULTLEN, + .name = "md4", + .context_size = sizeof(struct md4_context), + .digest_size = MD4_RESULTLEN, - hash_method_init_md4, - hash_method_loop_md4, - hash_method_result_md4 + .init = hash_method_init_md4, + .loop = hash_method_loop_md4, + .result = hash_method_result_md4, }; diff --git a/src/lib/md5.c b/src/lib/md5.c index 096e10fff5..a479b80c9d 100644 --- a/src/lib/md5.c +++ b/src/lib/md5.c @@ -303,11 +303,11 @@ static void hash_method_result_md5(void *context, unsigned char *result_r) } const struct hash_method hash_method_md5 = { - "md5", - sizeof(struct md5_context), - MD5_RESULTLEN, + .name = "md5", + .context_size = sizeof(struct md5_context), + .digest_size = MD5_RESULTLEN, - hash_method_init_md5, - hash_method_loop_md5, - hash_method_result_md5 + .init = hash_method_init_md5, + .loop = hash_method_loop_md5, + .result = hash_method_result_md5, }; diff --git a/src/lib/sha1.c b/src/lib/sha1.c index 781e54b325..62379e1634 100644 --- a/src/lib/sha1.c +++ b/src/lib/sha1.c @@ -277,11 +277,11 @@ static void hash_method_result_sha1(void *context, unsigned char *result_r) } const struct hash_method hash_method_sha1 = { - "sha1", - sizeof(struct sha1_ctxt), - SHA1_RESULTLEN, + .name = "sha1", + .context_size = sizeof(struct sha1_ctxt), + .digest_size = SHA1_RESULTLEN, - hash_method_init_sha1, - hash_method_loop_sha1, - hash_method_result_sha1 + .init = hash_method_init_sha1, + .loop = hash_method_loop_sha1, + .result = hash_method_result_sha1, }; diff --git a/src/lib/sha2.c b/src/lib/sha2.c index cf058c5be7..db7f82c0ed 100644 --- a/src/lib/sha2.c +++ b/src/lib/sha2.c @@ -441,13 +441,13 @@ static void hash_method_result_sha256(void *context, unsigned char *result_r) } const struct hash_method hash_method_sha256 = { - "sha256", - sizeof(struct sha256_ctx), - SHA256_RESULTLEN, + .name = "sha256", + .context_size = sizeof(struct sha256_ctx), + .digest_size = SHA256_RESULTLEN, - hash_method_init_sha256, - hash_method_loop_sha256, - hash_method_result_sha256 + .init = hash_method_init_sha256, + .loop = hash_method_loop_sha256, + .result = hash_method_result_sha256, }; static void hash_method_init_sha512(void *context) @@ -465,11 +465,11 @@ static void hash_method_result_sha512(void *context, unsigned char *result_r) } const struct hash_method hash_method_sha512 = { - "sha512", - sizeof(struct sha512_ctx), - SHA512_RESULTLEN, + .name = "sha512", + .context_size = sizeof(struct sha512_ctx), + .digest_size = SHA512_RESULTLEN, - hash_method_init_sha512, - hash_method_loop_sha512, - hash_method_result_sha512 + .init = hash_method_init_sha512, + .loop = hash_method_loop_sha512, + .result = hash_method_result_sha512, }; diff --git a/src/lib/sha3.c b/src/lib/sha3.c index e8d1c694d2..a8bdfcdc6a 100644 --- a/src/lib/sha3.c +++ b/src/lib/sha3.c @@ -303,13 +303,13 @@ static void hash_method_result_sha3_256(void *context, unsigned char *result_r) } const struct hash_method hash_method_sha3_256 = { - "sha3-256", - sizeof(struct sha3_ctx), - SHA256_RESULTLEN, + .name = "sha3-256", + .context_size = sizeof(struct sha3_ctx), + .digest_size = SHA256_RESULTLEN, - hash_method_init_sha3_256, - hash_method_loop_sha3, - hash_method_result_sha3_256 + .init = hash_method_init_sha3_256, + .loop = hash_method_loop_sha3, + .result = hash_method_result_sha3_256, }; static void hash_method_init_sha3_512(void *context) @@ -323,11 +323,11 @@ static void hash_method_result_sha3_512(void *context, unsigned char *result_r) } const struct hash_method hash_method_sha3_512 = { - "sha3-512", - sizeof(struct sha3_ctx), - SHA512_RESULTLEN, + .name = "sha3-512", + .context_size = sizeof(struct sha3_ctx), + .digest_size = SHA512_RESULTLEN, - hash_method_init_sha3_512, - hash_method_loop_sha3, - hash_method_result_sha3_512 + .init = hash_method_init_sha3_512, + .loop = hash_method_loop_sha3, + .result = hash_method_result_sha3_512, };