algapi.h (a7c391f04fe3259fb0417d71fec78ae28f25780e) algapi.h (45fe93dff2fb58b22de04c729f8447ba0f773d93)
1/*
2 * Cryptographic API for algorithms (i.e., low-level API).
3 *
4 * Copyright (c) 2006 Herbert Xu <herbert@gondor.apana.org.au>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)

--- 197 unchanged lines hidden (view full) ---

206 *d++ ^= *s++;
207 size -= sizeof(unsigned long);
208 }
209 } else {
210 __crypto_xor(dst, dst, src, size);
211 }
212}
213
1/*
2 * Cryptographic API for algorithms (i.e., low-level API).
3 *
4 * Copyright (c) 2006 Herbert Xu <herbert@gondor.apana.org.au>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)

--- 197 unchanged lines hidden (view full) ---

206 *d++ ^= *s++;
207 size -= sizeof(unsigned long);
208 }
209 } else {
210 __crypto_xor(dst, dst, src, size);
211 }
212}
213
214static inline void crypto_xor_cpy(u8 *dst, const u8 *src1, const u8 *src2,
215 unsigned int size)
216{
217 if (IS_ENABLED(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) &&
218 __builtin_constant_p(size) &&
219 (size % sizeof(unsigned long)) == 0) {
220 unsigned long *d = (unsigned long *)dst;
221 unsigned long *s1 = (unsigned long *)src1;
222 unsigned long *s2 = (unsigned long *)src2;
223
224 while (size > 0) {
225 *d++ = *s1++ ^ *s2++;
226 size -= sizeof(unsigned long);
227 }
228 } else {
229 __crypto_xor(dst, src1, src2, size);
230 }
231}
232
214int blkcipher_walk_done(struct blkcipher_desc *desc,
215 struct blkcipher_walk *walk, int err);
216int blkcipher_walk_virt(struct blkcipher_desc *desc,
217 struct blkcipher_walk *walk);
218int blkcipher_walk_phys(struct blkcipher_desc *desc,
219 struct blkcipher_walk *walk);
220int blkcipher_walk_virt_block(struct blkcipher_desc *desc,
221 struct blkcipher_walk *walk,

--- 181 unchanged lines hidden ---
233int blkcipher_walk_done(struct blkcipher_desc *desc,
234 struct blkcipher_walk *walk, int err);
235int blkcipher_walk_virt(struct blkcipher_desc *desc,
236 struct blkcipher_walk *walk);
237int blkcipher_walk_phys(struct blkcipher_desc *desc,
238 struct blkcipher_walk *walk);
239int blkcipher_walk_virt_block(struct blkcipher_desc *desc,
240 struct blkcipher_walk *walk,

--- 181 unchanged lines hidden ---