2015-07-16 11:14:00 -06:00
|
|
|
/*
|
|
|
|
* Common values for the ChaCha20 algorithm
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _CRYPTO_CHACHA20_H
|
|
|
|
#define _CRYPTO_CHACHA20_H
|
|
|
|
|
2016-12-09 07:33:51 -07:00
|
|
|
#include <crypto/skcipher.h>
|
2015-07-16 11:14:00 -06:00
|
|
|
#include <linux/types.h>
|
|
|
|
#include <linux/crypto.h>
|
|
|
|
|
|
|
|
#define CHACHA20_IV_SIZE 16
|
|
|
|
#define CHACHA20_KEY_SIZE 32
|
|
|
|
#define CHACHA20_BLOCK_SIZE 64
|
|
|
|
|
|
|
|
struct chacha20_ctx {
|
|
|
|
u32 key[8];
|
|
|
|
};
|
|
|
|
|
2016-06-12 16:13:36 -06:00
|
|
|
void chacha20_block(u32 *state, void *stream);
|
2015-07-16 11:14:00 -06:00
|
|
|
void crypto_chacha20_init(u32 *state, struct chacha20_ctx *ctx, u8 *iv);
|
2016-12-09 07:33:51 -07:00
|
|
|
int crypto_chacha20_setkey(struct crypto_skcipher *tfm, const u8 *key,
|
2015-07-16 11:14:00 -06:00
|
|
|
unsigned int keysize);
|
2016-12-09 07:33:51 -07:00
|
|
|
int crypto_chacha20_crypt(struct skcipher_request *req);
|
2015-07-16 11:14:00 -06:00
|
|
|
|
|
|
|
#endif
|