-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
crypto: salsa20 - export generic helpers
Export the Salsa20 constants, transform context, and initialization functions so that they can be reused by the x86 implementation. Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
- Loading branch information
Showing
2 changed files
with
34 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
/* | ||
* Common values for the Salsa20 algorithm | ||
*/ | ||
|
||
#ifndef _CRYPTO_SALSA20_H | ||
#define _CRYPTO_SALSA20_H | ||
|
||
#include <linux/types.h> | ||
|
||
#define SALSA20_IV_SIZE 8 | ||
#define SALSA20_MIN_KEY_SIZE 16 | ||
#define SALSA20_MAX_KEY_SIZE 32 | ||
#define SALSA20_BLOCK_SIZE 64 | ||
|
||
struct crypto_skcipher; | ||
|
||
struct salsa20_ctx { | ||
u32 initial_state[16]; | ||
}; | ||
|
||
void crypto_salsa20_init(u32 *state, const struct salsa20_ctx *ctx, | ||
const u8 *iv); | ||
int crypto_salsa20_setkey(struct crypto_skcipher *tfm, const u8 *key, | ||
unsigned int keysize); | ||
|
||
#endif /* _CRYPTO_SALSA20_H */ |