hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/drivers/crypto/n2_core.c
....@@ -1228,6 +1228,7 @@
12281228 const u8 *hash_init;
12291229 u8 hw_op_hashsz;
12301230 u8 digest_size;
1231
+ u8 statesize;
12311232 u8 block_size;
12321233 u8 auth_type;
12331234 u8 hmac_type;
....@@ -1259,6 +1260,7 @@
12591260 .hmac_type = AUTH_TYPE_HMAC_MD5,
12601261 .hw_op_hashsz = MD5_DIGEST_SIZE,
12611262 .digest_size = MD5_DIGEST_SIZE,
1263
+ .statesize = sizeof(struct md5_state),
12621264 .block_size = MD5_HMAC_BLOCK_SIZE },
12631265 { .name = "sha1",
12641266 .hash_zero = sha1_zero_message_hash,
....@@ -1267,6 +1269,7 @@
12671269 .hmac_type = AUTH_TYPE_HMAC_SHA1,
12681270 .hw_op_hashsz = SHA1_DIGEST_SIZE,
12691271 .digest_size = SHA1_DIGEST_SIZE,
1272
+ .statesize = sizeof(struct sha1_state),
12701273 .block_size = SHA1_BLOCK_SIZE },
12711274 { .name = "sha256",
12721275 .hash_zero = sha256_zero_message_hash,
....@@ -1275,6 +1278,7 @@
12751278 .hmac_type = AUTH_TYPE_HMAC_SHA256,
12761279 .hw_op_hashsz = SHA256_DIGEST_SIZE,
12771280 .digest_size = SHA256_DIGEST_SIZE,
1281
+ .statesize = sizeof(struct sha256_state),
12781282 .block_size = SHA256_BLOCK_SIZE },
12791283 { .name = "sha224",
12801284 .hash_zero = sha224_zero_message_hash,
....@@ -1283,6 +1287,7 @@
12831287 .hmac_type = AUTH_TYPE_RESERVED,
12841288 .hw_op_hashsz = SHA256_DIGEST_SIZE,
12851289 .digest_size = SHA224_DIGEST_SIZE,
1290
+ .statesize = sizeof(struct sha256_state),
12861291 .block_size = SHA224_BLOCK_SIZE },
12871292 };
12881293 #define NUM_HASH_TMPLS ARRAY_SIZE(hash_tmpls)
....@@ -1423,6 +1428,7 @@
14231428
14241429 halg = &ahash->halg;
14251430 halg->digestsize = tmpl->digest_size;
1431
+ halg->statesize = tmpl->statesize;
14261432
14271433 base = &halg->base;
14281434 snprintf(base->cra_name, CRYPTO_MAX_ALG_NAME, "%s", tmpl->name);