diff options
author | Conrad Meyer <cem@FreeBSD.org> | 2017-09-26 17:52:52 +0000 |
---|---|---|
committer | Conrad Meyer <cem@FreeBSD.org> | 2017-09-26 17:52:52 +0000 |
commit | 255811d758fb82798c83f4690879cca15d7f2329 (patch) | |
tree | 646f80dd4e71b2a13985631b497150b5245cca3d /sys/crypto | |
parent | 3693b18840d868f11e273d24a63eb3e6b7b9d2de (diff) | |
download | src-255811d758fb82798c83f4690879cca15d7f2329.tar.gz src-255811d758fb82798c83f4690879cca15d7f2329.zip |
opencrypto: Use C99 initializers for auth_hash instances
A misordering in the Via padlock driver really strongly suggested that these
should use C99 named initializers.
No functional change.
Sponsored by: Dell EMC Isilon
Notes
Notes:
svn path=/head/; revision=324019
Diffstat (limited to 'sys/crypto')
-rw-r--r-- | sys/crypto/via/padlock_hash.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/sys/crypto/via/padlock_hash.c b/sys/crypto/via/padlock_hash.c index 33ef89bb3358..ebc88787a934 100644 --- a/sys/crypto/via/padlock_hash.c +++ b/sys/crypto/via/padlock_hash.c @@ -81,21 +81,27 @@ static void padlock_sha1_final(uint8_t *hash, struct padlock_sha_ctx *ctx); static void padlock_sha256_final(uint8_t *hash, struct padlock_sha_ctx *ctx); static struct auth_hash padlock_hmac_sha1 = { - CRYPTO_SHA1_HMAC, "HMAC-SHA1", - SHA1_HMAC_BLOCK_LEN, SHA1_HASH_LEN, sizeof(struct padlock_sha_ctx), - SHA1_HMAC_BLOCK_LEN, - (void (*)(void *))padlock_sha_init, NULL, NULL, - (int (*)(void *, const uint8_t *, uint16_t))padlock_sha_update, - (void (*)(uint8_t *, void *))padlock_sha1_final + .type = CRYPTO_SHA1_HMAC, + .name = "HMAC-SHA1", + .keysize = SHA1_HMAC_BLOCK_LEN, + .hashsize = SHA1_HASH_LEN, + .ctxsize = sizeof(struct padlock_sha_ctx), + .blocksize = SHA1_HMAC_BLOCK_LEN, + .Init = (void (*)(void *))padlock_sha_init, + .Update = (int (*)(void *, const uint8_t *, uint16_t))padlock_sha_update, + .Final = (void (*)(uint8_t *, void *))padlock_sha1_final, }; static struct auth_hash padlock_hmac_sha256 = { - CRYPTO_SHA2_256_HMAC, "HMAC-SHA2-256", - SHA2_256_HMAC_BLOCK_LEN, SHA2_256_HASH_LEN, - sizeof(struct padlock_sha_ctx), SHA2_256_HMAC_BLOCK_LEN, - (void (*)(void *))padlock_sha_init, NULL, NULL, - (int (*)(void *, const uint8_t *, uint16_t))padlock_sha_update, - (void (*)(uint8_t *, void *))padlock_sha256_final + .type = CRYPTO_SHA2_256_HMAC, + .name = "HMAC-SHA2-256", + .keysize = SHA2_256_HMAC_BLOCK_LEN, + .hashsize = SHA2_256_HASH_LEN, + .ctxsize = sizeof(struct padlock_sha_ctx), + .blocksize = SHA2_256_HMAC_BLOCK_LEN, + .Init = (void (*)(void *))padlock_sha_init, + .Update = (int (*)(void *, const uint8_t *, uint16_t))padlock_sha_update, + .Final = (void (*)(uint8_t *, void *))padlock_sha256_final, }; MALLOC_DECLARE(M_PADLOCK); |