#include "aes/rijndael.h"
Go to the source code of this file.
|
long int | dtls_ccm_encrypt_message (rijndael_ctx *ctx, size_t M, size_t L, unsigned char nonce[DTLS_CCM_BLOCKSIZE], unsigned char *msg, size_t lm, const unsigned char *aad, size_t la) |
|
long int | dtls_ccm_decrypt_message (rijndael_ctx *ctx, size_t M, size_t L, unsigned char nonce[DTLS_CCM_BLOCKSIZE], unsigned char *msg, size_t lm, const unsigned char *aad, size_t la) |
|
#define DTLS_CCM_BLOCKSIZE 16 |
size of hmac blocks
Definition at line 33 of file ccm.h.
max number of bytes in digest
Definition at line 34 of file ccm.h.
#define DTLS_CCM_NONCE_SIZE 12 |
size of nonce
Definition at line 35 of file ccm.h.
long int dtls_ccm_decrypt_message |
( |
rijndael_ctx * |
ctx, |
|
|
size_t |
M, |
|
|
size_t |
L, |
|
|
unsigned char |
nonce[DTLS_CCM_BLOCKSIZE], |
|
|
unsigned char * |
msg, |
|
|
size_t |
lm, |
|
|
const unsigned char * |
aad, |
|
|
size_t |
la |
|
) |
| |
long int dtls_ccm_encrypt_message |
( |
rijndael_ctx * |
ctx, |
|
|
size_t |
M, |
|
|
size_t |
L, |
|
|
unsigned char |
nonce[DTLS_CCM_BLOCKSIZE], |
|
|
unsigned char * |
msg, |
|
|
size_t |
lm, |
|
|
const unsigned char * |
aad, |
|
|
size_t |
la |
|
) |
| |
Authenticates and encrypts a message using AES in CCM mode. Please see also RFC 3610 for the meaning of M
, L
, lm
and la
.
- Parameters
-
ctx | The initialized rijndael_ctx object to be used for AES operations. |
M | The number of authentication octets. |
L | The number of bytes used to encode the message length. |
N | The nonce value to use. You must provide DTLS_CCM_BLOCKSIZE nonce octets, although only the first 16 - L are used. |
msg | The message to encrypt. The first la octets are additional authentication data that will be cleartext. Note that the encryption operation modifies the contents of msg and adds M bytes MAC. Therefore, the buffer must be at least lm + M bytes large. |
lm | The actual length of msg . |
aad | A pointer to the additional authentication data (can be NULL if la is zero). |
la | The number of additional authentication octets (may be zero). |
- Returns
- FIXME
Definition at line 176 of file ccm.c.