11/***************************************************************************/ /**
2- * @file em_aes.h
2+ * @file
33 * @brief Advanced encryption standard (AES) accelerator peripheral API.
4- * @version 5.3.3
54 *******************************************************************************
65 * # License
7- * <b>Copyright 2016 Silicon Laboratories, Inc. http:// www.silabs.com</b>
6+ * <b>Copyright 2018 Silicon Laboratories Inc. www.silabs.com</b>
87 *******************************************************************************
98 *
9+ * SPDX-License-Identifier: Zlib
10+ *
11+ * The licensor of this software is Silicon Laboratories Inc.
12+ *
13+ * This software is provided 'as-is', without any express or implied
14+ * warranty. In no event will the authors be held liable for any damages
15+ * arising from the use of this software.
16+ *
1017 * Permission is granted to anyone to use this software for any purpose,
1118 * including commercial applications, and to alter it and redistribute it
1219 * freely, subject to the following restrictions:
1320 *
1421 * 1. The origin of this software must not be misrepresented; you must not
15- * claim that you wrote the original software.
22+ * claim that you wrote the original software. If you use this software
23+ * in a product, an acknowledgment in the product documentation would be
24+ * appreciated but is not required.
1625 * 2. Altered source versions must be plainly marked as such, and must not be
1726 * misrepresented as being the original software.
1827 * 3. This notice may not be removed or altered from any source distribution.
1928 *
20- * DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Silicon Labs has no
21- * obligation to support this Software. Silicon Labs is providing the
22- * Software "AS IS", with no express or implied warranties of any kind,
23- * including, but not limited to, any implied warranties of merchantability
24- * or fitness for any particular purpose or warranties against infringement
25- * of any proprietary rights of a third party.
26- *
27- * Silicon Labs will not be liable for any consequential, incidental, or
28- * special damages, or any other relief, or for any claim by any third party,
29- * arising from your use of this Software.
30- *
3129 ******************************************************************************/
3230
3331#ifndef EM_AES_H
@@ -62,26 +60,26 @@ extern "C" {
6260 *
6361 * The following input/output notations should be noted:
6462 *
65- * @li Input/output data (plaintext, ciphertext, key etc ) are treated as
66- * byte arrays, starting with most significant byte. Ie , 32 bytes of
63+ * @li Input/output data (plaintext, ciphertext, key, and so on ) are treated as
64+ * byte arrays, starting with the most significant byte, i.e. , 32 bytes of
6765 * plaintext (B0...B31) is located in memory in the same order, with B0 at
6866 * the lower address and B31 at the higher address.
6967 *
70- * @li Byte arrays must always be a multiple of AES block size, ie a multiple
68+ * @li Byte arrays must always be a multiple of AES block size, i.e., a multiple
7169 * of 16. Padding, if required, is done at the end of the byte array.
7270 *
7371 * @li Byte arrays should be word (32 bit) aligned for performance
74- * considerations, since the array is accessed with 32 bit access type.
75- * The Cortex-M supports unaligned accesses, but with a performance penalty.
72+ * considerations, since the array is accessed with a 32 bit access type.
73+ * Cortex-M supports unaligned accesses with a performance penalty.
7674 *
77- * @li It is possible to specify the same output buffer as input buffer
78- * as long as they point to the same address. In that case the provided input
79- * buffer is replaced with the encrypted/decrypted output. Notice that the
75+ * @li It is possible to specify the same output buffer as an input buffer
76+ * as long as they point to the same address. In that case, the provided input
77+ * buffer is replaced with the encrypted/decrypted output. Notice that
8078 * buffers must be exactly overlapping. If partly overlapping, the
81- * behaviour is undefined.
79+ * behavior is undefined.
8280 *
83- * It is up to the user to use a cipher mode according to its requirements
84- * in order to not break security. Please refer to specific cipher mode
81+ * Use a cipher mode according to its requirements to avoid
82+ * breaking security. See a specific cipher mode
8583 * theory for details.
8684 *
8785 * References:
@@ -91,7 +89,7 @@ extern "C" {
9189 * NIST Special Publication 800-38A, 2001 Edition,
9290 * http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf
9391 *
94- * E.g. the following example shows how to perform an AES-128 CBC encryption:
92+ * The following example shows how to perform an AES-128 CBC encryption:
9593 *
9694 * Enable clocks:
9795 * @include em_aes_clock_enable.c
@@ -108,10 +106,10 @@ extern "C" {
108106
109107/**
110108 * @brief
111- * AES counter modification function pointer.
109+ * An AES counter modification function pointer.
112110 * @details
113111 * Parameters:
114- * @li ctr - Ptr to byte array (16 bytes) holding counter to be modified.
112+ * @li ctr - Ptr to byte array (16 bytes) holding a counter to be modified.
115113 */
116114typedef void (* AES_CtrFuncPtr_TypeDef )(uint8_t * ctr );
117115
@@ -194,7 +192,7 @@ void AES_ECB256(uint8_t *out,
194192 * Clear one or more pending AES interrupts.
195193 *
196194 * @param[in] flags
197- * Pending AES interrupt source to clear. Use a bitwise logic OR combination of
195+ * A pending AES interrupt source to clear. Use a bitwise logic OR combination of
198196 * valid interrupt flags for the AES module (AES_IF_nnn).
199197 ******************************************************************************/
200198__STATIC_INLINE void AES_IntClear (uint32_t flags )
@@ -207,7 +205,7 @@ __STATIC_INLINE void AES_IntClear(uint32_t flags)
207205 * Disable one or more AES interrupts.
208206 *
209207 * @param[in] flags
210- * AES interrupt sources to disable. Use a bitwise logic OR combination of
208+ * An AES interrupt sources to disable. Use a bitwise logic OR combination of
211209 * valid interrupt flags for the AES module (AES_IF_nnn).
212210 ******************************************************************************/
213211__STATIC_INLINE void AES_IntDisable (uint32_t flags )
@@ -220,9 +218,9 @@ __STATIC_INLINE void AES_IntDisable(uint32_t flags)
220218 * Enable one or more AES interrupts.
221219 *
222220 * @note
223- * Depending on the use, a pending interrupt may already be set prior to
221+ * Depending on use, a pending interrupt may already be set prior to
224222 * enabling the interrupt. Consider using AES_IntClear() prior to enabling
225- * if such a pending interrupt should be ignored.
223+ * if a pending interrupt should be ignored.
226224 *
227225 * @param[in] flags
228226 * AES interrupt sources to enable. Use a bitwise logic OR combination of
@@ -238,7 +236,7 @@ __STATIC_INLINE void AES_IntEnable(uint32_t flags)
238236 * Get pending AES interrupt flags.
239237 *
240238 * @note
241- * The event bits are not cleared by the use of this function .
239+ * This function does not clear event bits .
242240 *
243241 * @return
244242 * AES interrupt sources pending. A bitwise logic OR combination of valid
@@ -255,10 +253,10 @@ __STATIC_INLINE uint32_t AES_IntGet(void)
255253 * Useful for handling more interrupt sources in the same interrupt handler.
256254 *
257255 * @note
258- * Interrupt flags are not cleared by the use of this function .
256+ * This function does not clear interrupt flags .
259257 *
260258 * @return
261- * Pending and enabled AES interrupt sources
259+ * Pending and enabled AES interrupt sources.
262260 * The return value is the bitwise AND of
263261 * - the enabled interrupt sources in AES_IEN and
264262 * - the pending interrupt flags AES_IF
@@ -273,10 +271,10 @@ __STATIC_INLINE uint32_t AES_IntGetEnabled(void)
273271
274272/***************************************************************************/ /**
275273 * @brief
276- * Set one or more pending AES interrupts from SW .
274+ * Set one or more pending AES interrupts from software .
277275 *
278276 * @param[in] flags
279- * AES interrupt sources to set to pending. Use a bitwise logic OR combination
277+ * AES interrupt sources to set as pending. Use a bitwise logic OR combination
280278 * of valid interrupt flags for the AES module (AES_IF_nnn).
281279 ******************************************************************************/
282280__STATIC_INLINE void AES_IntSet (uint32_t flags )
0 commit comments