.. | .. |
---|
9 | 9 | * Salsa20 is a stream cipher candidate in eSTREAM, the ECRYPT Stream |
---|
10 | 10 | * Cipher Project. It is designed by Daniel J. Bernstein <djb@cr.yp.to>. |
---|
11 | 11 | * More information about eSTREAM and Salsa20 can be found here: |
---|
12 | | - * http://www.ecrypt.eu.org/stream/ |
---|
13 | | - * http://cr.yp.to/snuffle.html |
---|
| 12 | + * https://www.ecrypt.eu.org/stream/ |
---|
| 13 | + * https://cr.yp.to/snuffle.html |
---|
14 | 14 | * |
---|
15 | 15 | * This program is free software; you can redistribute it and/or modify it |
---|
16 | 16 | * under the terms of the GNU General Public License as published by the Free |
---|
.. | .. |
---|
86 | 86 | { |
---|
87 | 87 | __le32 stream[SALSA20_BLOCK_SIZE / sizeof(__le32)]; |
---|
88 | 88 | |
---|
89 | | - if (dst != src) |
---|
90 | | - memcpy(dst, src, bytes); |
---|
91 | | - |
---|
92 | 89 | while (bytes >= SALSA20_BLOCK_SIZE) { |
---|
93 | 90 | salsa20_block(state, stream); |
---|
94 | | - crypto_xor(dst, (const u8 *)stream, SALSA20_BLOCK_SIZE); |
---|
| 91 | + crypto_xor_cpy(dst, src, (const u8 *)stream, |
---|
| 92 | + SALSA20_BLOCK_SIZE); |
---|
95 | 93 | bytes -= SALSA20_BLOCK_SIZE; |
---|
96 | 94 | dst += SALSA20_BLOCK_SIZE; |
---|
| 95 | + src += SALSA20_BLOCK_SIZE; |
---|
97 | 96 | } |
---|
98 | 97 | if (bytes) { |
---|
99 | 98 | salsa20_block(state, stream); |
---|
100 | | - crypto_xor(dst, (const u8 *)stream, bytes); |
---|
| 99 | + crypto_xor_cpy(dst, src, (const u8 *)stream, bytes); |
---|
101 | 100 | } |
---|
102 | 101 | } |
---|
103 | 102 | |
---|
.. | .. |
---|
159 | 158 | u32 state[16]; |
---|
160 | 159 | int err; |
---|
161 | 160 | |
---|
162 | | - err = skcipher_walk_virt(&walk, req, true); |
---|
| 161 | + err = skcipher_walk_virt(&walk, req, false); |
---|
163 | 162 | |
---|
164 | 163 | salsa20_init(state, ctx, req->iv); |
---|
165 | 164 | |
---|
.. | .. |
---|
204 | 203 | crypto_unregister_skcipher(&alg); |
---|
205 | 204 | } |
---|
206 | 205 | |
---|
207 | | -module_init(salsa20_generic_mod_init); |
---|
| 206 | +subsys_initcall(salsa20_generic_mod_init); |
---|
208 | 207 | module_exit(salsa20_generic_mod_fini); |
---|
209 | 208 | |
---|
210 | 209 | MODULE_LICENSE("GPL"); |
---|