tinydtls  0.8.6
ccm.h
Go to the documentation of this file.
1 /*******************************************************************************
2  *
3  * Copyright (c) 2011, 2012, 2013, 2014, 2015 Olaf Bergmann (TZI) and others.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * and Eclipse Distribution License v. 1.0 which accompanies this distribution.
7  *
8  * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
9  * and the Eclipse Distribution License is available at
10  * http://www.eclipse.org/org/documents/edl-v10.php.
11  *
12  * Contributors:
13  * Olaf Bergmann - initial API and implementation
14  * Hauke Mehrtens - memory optimization, ECC integration
15  *
16  *******************************************************************************/
17 
18 #ifndef _DTLS_CCM_H_
19 #define _DTLS_CCM_H_
20 
21 #include "aes/rijndael.h"
22 
23 /* implementation of Counter Mode CBC-MAC, RFC 3610 */
24 
25 #define DTLS_CCM_BLOCKSIZE 16
26 #define DTLS_CCM_MAX 16
27 #define DTLS_CCM_NONCE_SIZE 12
49 long int
50 dtls_ccm_encrypt_message(rijndael_ctx *ctx, size_t M, size_t L,
51  unsigned char nonce[DTLS_CCM_BLOCKSIZE],
52  unsigned char *msg, size_t lm,
53  const unsigned char *aad, size_t la);
54 
55 long int
56 dtls_ccm_decrypt_message(rijndael_ctx *ctx, size_t M, size_t L,
57  unsigned char nonce[DTLS_CCM_BLOCKSIZE],
58  unsigned char *msg, size_t lm,
59  const unsigned char *aad, size_t la);
60 
61 #endif /* _DTLS_CCM_H_ */
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)
Definition: ccm.c:168
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)
Definition: ccm.c:232
#define DTLS_CCM_BLOCKSIZE
Definition: ccm.h:25