diff options
Diffstat (limited to 'drivers/crypto/qce/sha.c')
-rw-r--r-- | drivers/crypto/qce/sha.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/crypto/qce/sha.c b/drivers/crypto/qce/sha.c index 3c33ac9c8cba..f3385934eed2 100644 --- a/drivers/crypto/qce/sha.c +++ b/drivers/crypto/qce/sha.c | |||
@@ -25,11 +25,11 @@ | |||
25 | 25 | ||
26 | static LIST_HEAD(ahash_algs); | 26 | static LIST_HEAD(ahash_algs); |
27 | 27 | ||
28 | static const __be32 std_iv_sha1[SHA256_DIGEST_SIZE / sizeof(__be32)] = { | 28 | static const u32 std_iv_sha1[SHA256_DIGEST_SIZE / sizeof(u32)] = { |
29 | SHA1_H0, SHA1_H1, SHA1_H2, SHA1_H3, SHA1_H4, 0, 0, 0 | 29 | SHA1_H0, SHA1_H1, SHA1_H2, SHA1_H3, SHA1_H4, 0, 0, 0 |
30 | }; | 30 | }; |
31 | 31 | ||
32 | static const __be32 std_iv_sha256[SHA256_DIGEST_SIZE / sizeof(__be32)] = { | 32 | static const u32 std_iv_sha256[SHA256_DIGEST_SIZE / sizeof(u32)] = { |
33 | SHA256_H0, SHA256_H1, SHA256_H2, SHA256_H3, | 33 | SHA256_H0, SHA256_H1, SHA256_H2, SHA256_H3, |
34 | SHA256_H4, SHA256_H5, SHA256_H6, SHA256_H7 | 34 | SHA256_H4, SHA256_H5, SHA256_H6, SHA256_H7 |
35 | }; | 35 | }; |
@@ -132,7 +132,7 @@ static int qce_ahash_init(struct ahash_request *req) | |||
132 | { | 132 | { |
133 | struct qce_sha_reqctx *rctx = ahash_request_ctx(req); | 133 | struct qce_sha_reqctx *rctx = ahash_request_ctx(req); |
134 | struct qce_alg_template *tmpl = to_ahash_tmpl(req->base.tfm); | 134 | struct qce_alg_template *tmpl = to_ahash_tmpl(req->base.tfm); |
135 | const __be32 *std_iv = tmpl->std_iv; | 135 | const u32 *std_iv = tmpl->std_iv; |
136 | 136 | ||
137 | memset(rctx, 0, sizeof(*rctx)); | 137 | memset(rctx, 0, sizeof(*rctx)); |
138 | rctx->first_blk = true; | 138 | rctx->first_blk = true; |
@@ -156,15 +156,15 @@ static int qce_ahash_export(struct ahash_request *req, void *out) | |||
156 | struct sha1_state *out_state = out; | 156 | struct sha1_state *out_state = out; |
157 | 157 | ||
158 | out_state->count = rctx->count; | 158 | out_state->count = rctx->count; |
159 | qce_cpu_to_be32p_array(out_state->state, rctx->digest, | 159 | qce_cpu_to_be32p_array((__be32 *)out_state->state, |
160 | digestsize); | 160 | rctx->digest, digestsize); |
161 | memcpy(out_state->buffer, rctx->buf, blocksize); | 161 | memcpy(out_state->buffer, rctx->buf, blocksize); |
162 | } else if (IS_SHA256(flags) || IS_SHA256_HMAC(flags)) { | 162 | } else if (IS_SHA256(flags) || IS_SHA256_HMAC(flags)) { |
163 | struct sha256_state *out_state = out; | 163 | struct sha256_state *out_state = out; |
164 | 164 | ||
165 | out_state->count = rctx->count; | 165 | out_state->count = rctx->count; |
166 | qce_cpu_to_be32p_array(out_state->state, rctx->digest, | 166 | qce_cpu_to_be32p_array((__be32 *)out_state->state, |
167 | digestsize); | 167 | rctx->digest, digestsize); |
168 | memcpy(out_state->buf, rctx->buf, blocksize); | 168 | memcpy(out_state->buf, rctx->buf, blocksize); |
169 | } else { | 169 | } else { |
170 | return -EINVAL; | 170 | return -EINVAL; |
@@ -199,8 +199,8 @@ static int qce_import_common(struct ahash_request *req, u64 in_count, | |||
199 | count += SHA_PADDING; | 199 | count += SHA_PADDING; |
200 | } | 200 | } |
201 | 201 | ||
202 | rctx->byte_count[0] = (__be32)(count & ~SHA_PADDING_MASK); | 202 | rctx->byte_count[0] = (__force __be32)(count & ~SHA_PADDING_MASK); |
203 | rctx->byte_count[1] = (__be32)(count >> 32); | 203 | rctx->byte_count[1] = (__force __be32)(count >> 32); |
204 | qce_cpu_to_be32p_array((__be32 *)rctx->digest, (const u8 *)state, | 204 | qce_cpu_to_be32p_array((__be32 *)rctx->digest, (const u8 *)state, |
205 | digestsize); | 205 | digestsize); |
206 | rctx->buflen = (unsigned int)(in_count & (blocksize - 1)); | 206 | rctx->buflen = (unsigned int)(in_count & (blocksize - 1)); |
@@ -454,7 +454,7 @@ struct qce_ahash_def { | |||
454 | unsigned int digestsize; | 454 | unsigned int digestsize; |
455 | unsigned int blocksize; | 455 | unsigned int blocksize; |
456 | unsigned int statesize; | 456 | unsigned int statesize; |
457 | const __be32 *std_iv; | 457 | const u32 *std_iv; |
458 | }; | 458 | }; |
459 | 459 | ||
460 | static const struct qce_ahash_def ahash_def[] = { | 460 | static const struct qce_ahash_def ahash_def[] = { |