}
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[] = {
}
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,
};
}
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,
};
}
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,
};
}
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)
}
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,
};
}
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)
}
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,
};