| .. | .. |
|---|
| 38 | 38 | void *ctx = crypto_skcipher_ctx(crypto_skcipher_reqtfm(req)); |
|---|
| 39 | 39 | const unsigned int bsize = 128 / 8; |
|---|
| 40 | 40 | struct skcipher_walk walk; |
|---|
| 41 | | - bool fpu_enabled = false; |
|---|
| 41 | + bool fpu_enabled; |
|---|
| 42 | 42 | unsigned int nbytes; |
|---|
| 43 | 43 | int err; |
|---|
| 44 | 44 | |
|---|
| .. | .. |
|---|
| 51 | 51 | unsigned int i; |
|---|
| 52 | 52 | |
|---|
| 53 | 53 | fpu_enabled = glue_fpu_begin(bsize, gctx->fpu_blocks_limit, |
|---|
| 54 | | - &walk, fpu_enabled, nbytes); |
|---|
| 54 | + &walk, false, nbytes); |
|---|
| 55 | 55 | for (i = 0; i < gctx->num_funcs; i++) { |
|---|
| 56 | 56 | func_bytes = bsize * gctx->funcs[i].num_blocks; |
|---|
| 57 | 57 | |
|---|
| .. | .. |
|---|
| 69 | 69 | if (nbytes < bsize) |
|---|
| 70 | 70 | break; |
|---|
| 71 | 71 | } |
|---|
| 72 | + glue_fpu_end(fpu_enabled); |
|---|
| 72 | 73 | err = skcipher_walk_done(&walk, nbytes); |
|---|
| 73 | 74 | } |
|---|
| 74 | | - |
|---|
| 75 | | - glue_fpu_end(fpu_enabled); |
|---|
| 76 | 75 | return err; |
|---|
| 77 | 76 | } |
|---|
| 78 | 77 | EXPORT_SYMBOL_GPL(glue_ecb_req_128bit); |
|---|
| .. | .. |
|---|
| 115 | 114 | void *ctx = crypto_skcipher_ctx(crypto_skcipher_reqtfm(req)); |
|---|
| 116 | 115 | const unsigned int bsize = 128 / 8; |
|---|
| 117 | 116 | struct skcipher_walk walk; |
|---|
| 118 | | - bool fpu_enabled = false; |
|---|
| 117 | + bool fpu_enabled; |
|---|
| 119 | 118 | unsigned int nbytes; |
|---|
| 120 | 119 | int err; |
|---|
| 121 | 120 | |
|---|
| .. | .. |
|---|
| 129 | 128 | u128 last_iv; |
|---|
| 130 | 129 | |
|---|
| 131 | 130 | fpu_enabled = glue_fpu_begin(bsize, gctx->fpu_blocks_limit, |
|---|
| 132 | | - &walk, fpu_enabled, nbytes); |
|---|
| 131 | + &walk, false, nbytes); |
|---|
| 133 | 132 | /* Start of the last block. */ |
|---|
| 134 | 133 | src += nbytes / bsize - 1; |
|---|
| 135 | 134 | dst += nbytes / bsize - 1; |
|---|
| .. | .. |
|---|
| 161 | 160 | done: |
|---|
| 162 | 161 | u128_xor(dst, dst, (u128 *)walk.iv); |
|---|
| 163 | 162 | *(u128 *)walk.iv = last_iv; |
|---|
| 163 | + glue_fpu_end(fpu_enabled); |
|---|
| 164 | 164 | err = skcipher_walk_done(&walk, nbytes); |
|---|
| 165 | 165 | } |
|---|
| 166 | 166 | |
|---|
| 167 | | - glue_fpu_end(fpu_enabled); |
|---|
| 168 | 167 | return err; |
|---|
| 169 | 168 | } |
|---|
| 170 | 169 | EXPORT_SYMBOL_GPL(glue_cbc_decrypt_req_128bit); |
|---|
| .. | .. |
|---|
| 175 | 174 | void *ctx = crypto_skcipher_ctx(crypto_skcipher_reqtfm(req)); |
|---|
| 176 | 175 | const unsigned int bsize = 128 / 8; |
|---|
| 177 | 176 | struct skcipher_walk walk; |
|---|
| 178 | | - bool fpu_enabled = false; |
|---|
| 177 | + bool fpu_enabled; |
|---|
| 179 | 178 | unsigned int nbytes; |
|---|
| 180 | 179 | int err; |
|---|
| 181 | 180 | |
|---|
| .. | .. |
|---|
| 189 | 188 | le128 ctrblk; |
|---|
| 190 | 189 | |
|---|
| 191 | 190 | fpu_enabled = glue_fpu_begin(bsize, gctx->fpu_blocks_limit, |
|---|
| 192 | | - &walk, fpu_enabled, nbytes); |
|---|
| 191 | + &walk, false, nbytes); |
|---|
| 193 | 192 | |
|---|
| 194 | 193 | be128_to_le128(&ctrblk, (be128 *)walk.iv); |
|---|
| 195 | 194 | |
|---|
| .. | .. |
|---|
| 213 | 212 | } |
|---|
| 214 | 213 | |
|---|
| 215 | 214 | le128_to_be128((be128 *)walk.iv, &ctrblk); |
|---|
| 215 | + glue_fpu_end(fpu_enabled); |
|---|
| 216 | 216 | err = skcipher_walk_done(&walk, nbytes); |
|---|
| 217 | 217 | } |
|---|
| 218 | | - |
|---|
| 219 | | - glue_fpu_end(fpu_enabled); |
|---|
| 220 | 218 | |
|---|
| 221 | 219 | if (nbytes) { |
|---|
| 222 | 220 | le128 ctrblk; |
|---|
| .. | .. |
|---|
| 278 | 276 | { |
|---|
| 279 | 277 | const unsigned int bsize = 128 / 8; |
|---|
| 280 | 278 | struct skcipher_walk walk; |
|---|
| 281 | | - bool fpu_enabled = false; |
|---|
| 279 | + bool fpu_enabled; |
|---|
| 282 | 280 | unsigned int nbytes; |
|---|
| 283 | 281 | int err; |
|---|
| 284 | 282 | |
|---|
| .. | .. |
|---|
| 289 | 287 | |
|---|
| 290 | 288 | /* set minimum length to bsize, for tweak_fn */ |
|---|
| 291 | 289 | fpu_enabled = glue_fpu_begin(bsize, gctx->fpu_blocks_limit, |
|---|
| 292 | | - &walk, fpu_enabled, |
|---|
| 290 | + &walk, false, |
|---|
| 293 | 291 | nbytes < bsize ? bsize : nbytes); |
|---|
| 294 | 292 | |
|---|
| 295 | 293 | /* calculate first value of T */ |
|---|
| 296 | 294 | tweak_fn(tweak_ctx, walk.iv, walk.iv); |
|---|
| 297 | 295 | |
|---|
| 298 | 296 | while (nbytes) { |
|---|
| 297 | + fpu_enabled = glue_fpu_begin(bsize, gctx->fpu_blocks_limit, |
|---|
| 298 | + &walk, fpu_enabled, |
|---|
| 299 | + nbytes < bsize ? bsize : nbytes); |
|---|
| 299 | 300 | nbytes = __glue_xts_req_128bit(gctx, crypt_ctx, &walk); |
|---|
| 300 | 301 | |
|---|
| 302 | + glue_fpu_end(fpu_enabled); |
|---|
| 303 | + fpu_enabled = false; |
|---|
| 301 | 304 | err = skcipher_walk_done(&walk, nbytes); |
|---|
| 302 | 305 | nbytes = walk.nbytes; |
|---|
| 303 | 306 | } |
|---|
| 304 | | - |
|---|
| 305 | | - glue_fpu_end(fpu_enabled); |
|---|
| 306 | 307 | |
|---|
| 307 | 308 | return err; |
|---|
| 308 | 309 | } |
|---|