Warning, file /include/nettle/chacha.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 #ifndef NETTLE_CHACHA_H_INCLUDED
0037 #define NETTLE_CHACHA_H_INCLUDED
0038
0039 #include "nettle-types.h"
0040
0041 #ifdef __cplusplus
0042 extern "C" {
0043 #endif
0044
0045
0046 #define chacha_set_key nettle_chacha_set_key
0047 #define chacha_set_nonce nettle_chacha_set_nonce
0048 #define chacha_set_nonce96 nettle_chacha_set_nonce96
0049 #define chacha_set_counter nettle_chacha_set_counter
0050 #define chacha_set_counter32 nettle_chacha_set_counter32
0051 #define chacha_crypt nettle_chacha_crypt
0052 #define chacha_crypt32 nettle_chacha_crypt32
0053
0054
0055 #define CHACHA_KEY_SIZE 32
0056 #define CHACHA_BLOCK_SIZE 64
0057 #define CHACHA_NONCE_SIZE 8
0058 #define CHACHA_NONCE96_SIZE 12
0059 #define CHACHA_COUNTER_SIZE 8
0060 #define CHACHA_COUNTER32_SIZE 4
0061
0062 #define _CHACHA_STATE_LENGTH 16
0063
0064 struct chacha_ctx
0065 {
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077 uint32_t state[_CHACHA_STATE_LENGTH];
0078 };
0079
0080 void
0081 chacha_set_key(struct chacha_ctx *ctx, const uint8_t *key);
0082
0083 void
0084 chacha_set_nonce(struct chacha_ctx *ctx, const uint8_t *nonce);
0085
0086 void
0087 chacha_set_nonce96(struct chacha_ctx *ctx, const uint8_t *nonce);
0088
0089 void
0090 chacha_set_counter(struct chacha_ctx *ctx, const uint8_t *counter);
0091
0092 void
0093 chacha_set_counter32(struct chacha_ctx *ctx, const uint8_t *counter);
0094
0095 void
0096 chacha_crypt(struct chacha_ctx *ctx, size_t length,
0097 uint8_t *dst, const uint8_t *src);
0098
0099 void
0100 chacha_crypt32(struct chacha_ctx *ctx, size_t length,
0101 uint8_t *dst, const uint8_t *src);
0102
0103 #ifdef __cplusplus
0104 }
0105 #endif
0106
0107 #endif