Contiki-NG
cc26xx-aes.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016, University of Bristol - http://www.bristol.ac.uk
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of the Institute nor the names of its contributors
14  * may be used to endorse or promote products derived from this software
15  * without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27  * SUCH DAMAGE.
28  */
29 /**
30  * \addtogroup cc26xx
31  * @{
32  *
33  * \defgroup cc26xx-aes CC26x0/CC13x0 AES-128
34  *
35  * AES-128 driver for the CC26x0/CC13x0 SoC
36  * @{
37  *
38  * \file
39  * Header file of the AES-128 driver for the CC26xx SoC
40  * \author
41  * Atis Elsts <atis.elsts@gmail.com>
42  */
43 #ifndef CC2538_AES_H_
44 #define CC2538_AES_H_
45 
46 #include "lib/aes-128.h"
47 
48 /**
49  * \brief Set a key to use in subsequent encryption & decryption operations.
50  * \param key The key to use
51  *
52  * The size of the key must be AES_128_KEY_LENGTH.
53  */
54 void cc26xx_aes_set_key(const uint8_t *key);
55 
56 /**
57  * \brief Encrypt a message using the SoC AES-128 hardware implementation
58  * \param plaintext_and_result In: message to encrypt, out: the encrypted message.
59  *
60  * The size of the message must be AES_128_BLOCK_SIZE.
61  * The key to use in the encryption must be set before calling this function.
62  */
63 void cc26xx_aes_encrypt(uint8_t *plaintext_and_result);
64 
65 /**
66  * \brief Decrypt a message using the SoC AES-128 hardware implementation
67  * \param cyphertext_and_result In: message to decrypt, out: the decrypted message.
68  *
69  * The size of the message must be AES_128_BLOCK_SIZE.
70  * The key to use in the decryption must be set before calling this function.
71  */
72 void cc26xx_aes_decrypt(uint8_t *cyphertext_and_result);
73 
74 extern const struct aes_128_driver cc26xx_aes_128_driver;
75 
76 #endif /* CC2538_AES_H_ */
77 /**
78  * @}
79  * @}
80  */
void cc26xx_aes_encrypt(uint8_t *plaintext_and_result)
Encrypt a message using the SoC AES-128 hardware implementation.
Definition: cc26xx-aes.c:111
Structure of AES drivers.
Definition: aes-128.h:57
void cc26xx_aes_set_key(const uint8_t *key)
Set a key to use in subsequent encryption & decryption operations.
Definition: cc26xx-aes.c:50
void cc26xx_aes_decrypt(uint8_t *cyphertext_and_result)
Decrypt a message using the SoC AES-128 hardware implementation.
Definition: cc26xx-aes.c:117
AES-128.