mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
[CRYPTO] all: Pass tfm instead of ctx to algorithms
Up until now algorithms have been happy to get a context pointer since they know everything that's in the tfm already (e.g., alignment, block size). However, once we have parameterised algorithms, such information will be specific to each tfm. So the algorithm API needs to be changed to pass the tfm structure instead of the context pointer. This patch is basically a text substitution. The only tricky bit is the assembly routines that need to get the context pointer offset through asm-offsets.h. Signed-off-by: Herbert Xu <[email protected]>
This commit is contained in:
parent
43600106e3
commit
6c2bb98bc3
37 changed files with 349 additions and 331 deletions
|
|
@ -24,9 +24,10 @@ struct arc4_ctx {
|
|||
u8 x, y;
|
||||
};
|
||||
|
||||
static int arc4_set_key(void *ctx_arg, const u8 *in_key, unsigned int key_len, u32 *flags)
|
||||
static int arc4_set_key(struct crypto_tfm *tfm, const u8 *in_key,
|
||||
unsigned int key_len, u32 *flags)
|
||||
{
|
||||
struct arc4_ctx *ctx = ctx_arg;
|
||||
struct arc4_ctx *ctx = crypto_tfm_ctx(tfm);
|
||||
int i, j = 0, k = 0;
|
||||
|
||||
ctx->x = 1;
|
||||
|
|
@ -48,9 +49,9 @@ static int arc4_set_key(void *ctx_arg, const u8 *in_key, unsigned int key_len, u
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void arc4_crypt(void *ctx_arg, u8 *out, const u8 *in)
|
||||
static void arc4_crypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
|
||||
{
|
||||
struct arc4_ctx *ctx = ctx_arg;
|
||||
struct arc4_ctx *ctx = crypto_tfm_ctx(tfm);
|
||||
|
||||
u8 *const S = ctx->S;
|
||||
u8 x = ctx->x;
|
||||
|
|
|
|||
Loading…
Reference in a new issue