Mbed TLS v2.28.8
Loading...
Searching...
No Matches
camellia.h
Go to the documentation of this file.
1
6/*
7 * Copyright The Mbed TLS Contributors
8 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
9 */
10#ifndef MBEDTLS_CAMELLIA_H
11#define MBEDTLS_CAMELLIA_H
12
13#if !defined(MBEDTLS_CONFIG_FILE)
14#include "mbedtls/config.h"
15#else
16#include MBEDTLS_CONFIG_FILE
17#endif
18
19#include <stddef.h>
20#include <stdint.h>
21
23
24#define MBEDTLS_CAMELLIA_ENCRYPT 1
25#define MBEDTLS_CAMELLIA_DECRYPT 0
26
27#if !defined(MBEDTLS_DEPRECATED_REMOVED)
28#define MBEDTLS_ERR_CAMELLIA_INVALID_KEY_LENGTH MBEDTLS_DEPRECATED_NUMERIC_CONSTANT(-0x0024)
29#endif /* !MBEDTLS_DEPRECATED_REMOVED */
31#define MBEDTLS_ERR_CAMELLIA_BAD_INPUT_DATA -0x0024
32
34#define MBEDTLS_ERR_CAMELLIA_INVALID_INPUT_LENGTH -0x0026
35
36/* MBEDTLS_ERR_CAMELLIA_HW_ACCEL_FAILED is deprecated and should not be used.
37 */
39#define MBEDTLS_ERR_CAMELLIA_HW_ACCEL_FAILED -0x0027
40
41#ifdef __cplusplus
42extern "C" {
43#endif
44
45#if !defined(MBEDTLS_CAMELLIA_ALT)
46// Regular implementation
47//
48
53 int nr;
54 uint32_t rk[68];
55}
57
58#else /* MBEDTLS_CAMELLIA_ALT */
59#include "camellia_alt.h"
60#endif /* MBEDTLS_CAMELLIA_ALT */
61
69
78
92 const unsigned char *key,
93 unsigned int keybits);
94
108 const unsigned char *key,
109 unsigned int keybits);
110
127 int mode,
128 const unsigned char input[16],
129 unsigned char output[16]);
130
131#if defined(MBEDTLS_CIPHER_MODE_CBC)
161 int mode,
162 size_t length,
163 unsigned char iv[16],
164 const unsigned char *input,
165 unsigned char *output);
166#endif /* MBEDTLS_CIPHER_MODE_CBC */
167
168#if defined(MBEDTLS_CIPHER_MODE_CFB)
207 int mode,
208 size_t length,
209 size_t *iv_off,
210 unsigned char iv[16],
211 const unsigned char *input,
212 unsigned char *output);
213#endif /* MBEDTLS_CIPHER_MODE_CFB */
214
215#if defined(MBEDTLS_CIPHER_MODE_CTR)
291 size_t length,
292 size_t *nc_off,
293 unsigned char nonce_counter[16],
294 unsigned char stream_block[16],
295 const unsigned char *input,
296 unsigned char *output);
297#endif /* MBEDTLS_CIPHER_MODE_CTR */
298
299#if defined(MBEDTLS_SELF_TEST)
300
307
308#endif /* MBEDTLS_SELF_TEST */
309
310#ifdef __cplusplus
311}
312#endif
313
314#endif /* camellia.h */
int mbedtls_camellia_self_test(int verbose)
Checkup routine.
int mbedtls_camellia_setkey_enc(mbedtls_camellia_context *ctx, const unsigned char *key, unsigned int keybits)
Perform a CAMELLIA key schedule operation for encryption.
int mbedtls_camellia_crypt_ecb(mbedtls_camellia_context *ctx, int mode, const unsigned char input[16], unsigned char output[16])
Perform a CAMELLIA-ECB block encryption/decryption operation.
int mbedtls_camellia_setkey_dec(mbedtls_camellia_context *ctx, const unsigned char *key, unsigned int keybits)
Perform a CAMELLIA key schedule operation for decryption.
int mbedtls_camellia_crypt_cbc(mbedtls_camellia_context *ctx, int mode, size_t length, unsigned char iv[16], const unsigned char *input, unsigned char *output)
Perform a CAMELLIA-CBC buffer encryption/decryption operation.
void mbedtls_camellia_init(mbedtls_camellia_context *ctx)
Initialize a CAMELLIA context.
struct mbedtls_camellia_context mbedtls_camellia_context
CAMELLIA context structure.
void mbedtls_camellia_free(mbedtls_camellia_context *ctx)
Clear a CAMELLIA context.
int mbedtls_camellia_crypt_ctr(mbedtls_camellia_context *ctx, size_t length, size_t *nc_off, unsigned char nonce_counter[16], unsigned char stream_block[16], const unsigned char *input, unsigned char *output)
Perform a CAMELLIA-CTR buffer encryption/decryption operation.
int mbedtls_camellia_crypt_cfb128(mbedtls_camellia_context *ctx, int mode, size_t length, size_t *iv_off, unsigned char iv[16], const unsigned char *input, unsigned char *output)
Perform a CAMELLIA-CFB128 buffer encryption/decryption operation.
Configuration options (set of defines)
Common and shared functions used by multiple modules in the Mbed TLS library.
CAMELLIA context structure.
Definition camellia.h:52