| .. | .. |
|---|
| 1228 | 1228 | const u8 *hash_init; |
|---|
| 1229 | 1229 | u8 hw_op_hashsz; |
|---|
| 1230 | 1230 | u8 digest_size; |
|---|
| 1231 | + u8 statesize; |
|---|
| 1231 | 1232 | u8 block_size; |
|---|
| 1232 | 1233 | u8 auth_type; |
|---|
| 1233 | 1234 | u8 hmac_type; |
|---|
| .. | .. |
|---|
| 1259 | 1260 | .hmac_type = AUTH_TYPE_HMAC_MD5, |
|---|
| 1260 | 1261 | .hw_op_hashsz = MD5_DIGEST_SIZE, |
|---|
| 1261 | 1262 | .digest_size = MD5_DIGEST_SIZE, |
|---|
| 1263 | + .statesize = sizeof(struct md5_state), |
|---|
| 1262 | 1264 | .block_size = MD5_HMAC_BLOCK_SIZE }, |
|---|
| 1263 | 1265 | { .name = "sha1", |
|---|
| 1264 | 1266 | .hash_zero = sha1_zero_message_hash, |
|---|
| .. | .. |
|---|
| 1267 | 1269 | .hmac_type = AUTH_TYPE_HMAC_SHA1, |
|---|
| 1268 | 1270 | .hw_op_hashsz = SHA1_DIGEST_SIZE, |
|---|
| 1269 | 1271 | .digest_size = SHA1_DIGEST_SIZE, |
|---|
| 1272 | + .statesize = sizeof(struct sha1_state), |
|---|
| 1270 | 1273 | .block_size = SHA1_BLOCK_SIZE }, |
|---|
| 1271 | 1274 | { .name = "sha256", |
|---|
| 1272 | 1275 | .hash_zero = sha256_zero_message_hash, |
|---|
| .. | .. |
|---|
| 1275 | 1278 | .hmac_type = AUTH_TYPE_HMAC_SHA256, |
|---|
| 1276 | 1279 | .hw_op_hashsz = SHA256_DIGEST_SIZE, |
|---|
| 1277 | 1280 | .digest_size = SHA256_DIGEST_SIZE, |
|---|
| 1281 | + .statesize = sizeof(struct sha256_state), |
|---|
| 1278 | 1282 | .block_size = SHA256_BLOCK_SIZE }, |
|---|
| 1279 | 1283 | { .name = "sha224", |
|---|
| 1280 | 1284 | .hash_zero = sha224_zero_message_hash, |
|---|
| .. | .. |
|---|
| 1283 | 1287 | .hmac_type = AUTH_TYPE_RESERVED, |
|---|
| 1284 | 1288 | .hw_op_hashsz = SHA256_DIGEST_SIZE, |
|---|
| 1285 | 1289 | .digest_size = SHA224_DIGEST_SIZE, |
|---|
| 1290 | + .statesize = sizeof(struct sha256_state), |
|---|
| 1286 | 1291 | .block_size = SHA224_BLOCK_SIZE }, |
|---|
| 1287 | 1292 | }; |
|---|
| 1288 | 1293 | #define NUM_HASH_TMPLS ARRAY_SIZE(hash_tmpls) |
|---|
| .. | .. |
|---|
| 1423 | 1428 | |
|---|
| 1424 | 1429 | halg = &ahash->halg; |
|---|
| 1425 | 1430 | halg->digestsize = tmpl->digest_size; |
|---|
| 1431 | + halg->statesize = tmpl->statesize; |
|---|
| 1426 | 1432 | |
|---|
| 1427 | 1433 | base = &halg->base; |
|---|
| 1428 | 1434 | snprintf(base->cra_name, CRYPTO_MAX_ALG_NAME, "%s", tmpl->name); |
|---|