File tree Expand file tree Collapse file tree 4 files changed +40
-16
lines changed
features/mbedtls/targets/TARGET_NUVOTON Expand file tree Collapse file tree 4 files changed +40
-16
lines changed Original file line number Diff line number Diff line change @@ -43,10 +43,15 @@ static void mbedtls_zeroize( void *v, size_t n )
43
43
while ( n -- ) * p ++ = 0 ;
44
44
}
45
45
46
- /* DMA compatible backup buffer if user buffer doesn't meet requirements
46
+ /* AES DMA compatible backup buffer if user buffer doesn't meet requirements
47
47
*
48
- * MAX_DMA_CHAIN_SIZE must be a multiple of 16-byte block size.
49
- * Its value is estimated to trade memory footprint off against performance.
48
+ * AES DMA buffer location requires to be:
49
+ * (1) Word-aligned
50
+ * (2) Located in 0x2xxxxxxx region. Check linker files to ensure global variables are placed in this region.
51
+ *
52
+ * AES DMA buffer size MAX_DMA_CHAIN_SIZE must be a multiple of 16-byte block size.
53
+ * Its value is estimated to trade memory footprint off against performance.
54
+ *
50
55
*/
51
56
#define MAX_DMA_CHAIN_SIZE (16*6)
52
57
MBED_ALIGN (4 ) static uint8_t au8OutputData [MAX_DMA_CHAIN_SIZE ];
@@ -133,7 +138,8 @@ static void __nvt_aes_crypt( mbedtls_aes_context *ctx,
133
138
* 1) Word-aligned
134
139
* 2) Located in 0x2xxxxxxx region
135
140
*/
136
- if ((! crypto_dma_buff_compat (au8OutputData , MAX_DMA_CHAIN_SIZE )) || (! crypto_dma_buff_compat (au8InputData , MAX_DMA_CHAIN_SIZE ))) {
141
+ if ((! crypto_dma_buff_compat (au8OutputData , MAX_DMA_CHAIN_SIZE )) ||
142
+ (! crypto_dma_buff_compat (au8InputData , MAX_DMA_CHAIN_SIZE ))) {
137
143
error ("Buffer for AES alter. DMA requires to be word-aligned and located in 0x20000000-0x2FFFFFFF region." );
138
144
}
139
145
Original file line number Diff line number Diff line change 26
26
#include "mbed_toolchain.h"
27
27
#include "mbed_error.h"
28
28
29
- /* DMA buffer
29
+ /* DES DMA compatible buffer requirements
30
30
*
31
- * MAXSIZE_DMABUF must be a multiple of 64-bit block size.
32
- * Its value is estimated to trade memory footprint off against performance.
31
+ * DES DMA buffer location requires to be:
32
+ * (1) Word-aligned
33
+ * (2) Located in 0x2xxxxxxx region. Check linker files to ensure global variables are placed in this region.
34
+ *
35
+ * DES DMA buffer size MAXSIZE_DMABUF must be a multiple of 64-bit block size.
36
+ * Its value is estimated to trade memory footprint off against performance.
37
+ *
33
38
*/
34
39
#define MAXSIZE_DMABUF (8 * 5)
35
40
MBED_ALIGN (4 ) static uint8_t dmabuf_in [MAXSIZE_DMABUF ];
@@ -314,7 +319,8 @@ static int mbedtls_des_docrypt(uint16_t keyopt, uint8_t key[3][MBEDTLS_DES_KEY_S
314
319
* 1) Word-aligned
315
320
* 2) Located in 0x2xxxxxxx region
316
321
*/
317
- if ((! crypto_dma_buff_compat (dmabuf_in , MAXSIZE_DMABUF )) || (! crypto_dma_buff_compat (dmabuf_out , MAXSIZE_DMABUF ))) {
322
+ if ((! crypto_dma_buff_compat (dmabuf_in , MAXSIZE_DMABUF )) ||
323
+ (! crypto_dma_buff_compat (dmabuf_out , MAXSIZE_DMABUF ))) {
318
324
error ("Buffer for DES alter. DMA requires to be word-aligned and located in 0x20000000-0x2FFFFFFF region." );
319
325
}
320
326
Original file line number Diff line number Diff line change @@ -43,10 +43,15 @@ static void mbedtls_zeroize( void *v, size_t n )
43
43
while ( n -- ) * p ++ = 0 ;
44
44
}
45
45
46
- /* DMA compatible backup buffer if user buffer doesn't meet requirements
46
+ /* AES DMA compatible backup buffer if user buffer doesn't meet requirements
47
47
*
48
- * MAX_DMA_CHAIN_SIZE must be a multiple of 16-byte block size.
49
- * Its value is estimated to trade memory footprint off against performance.
48
+ * AES DMA buffer location requires to be:
49
+ * (1) Word-aligned
50
+ * (2) Located in 0x2xxxxxxx region. Check linker files to ensure global variables are placed in this region.
51
+ *
52
+ * AES DMA buffer size MAX_DMA_CHAIN_SIZE must be a multiple of 16-byte block size.
53
+ * Its value is estimated to trade memory footprint off against performance.
54
+ *
50
55
*/
51
56
#define MAX_DMA_CHAIN_SIZE (16*6)
52
57
MBED_ALIGN (4 ) static uint8_t au8OutputData [MAX_DMA_CHAIN_SIZE ];
@@ -133,7 +138,8 @@ static void __nvt_aes_crypt( mbedtls_aes_context *ctx,
133
138
* 1) Word-aligned
134
139
* 2) Located in 0x2xxxxxxx region
135
140
*/
136
- if ((! crypto_dma_buff_compat (au8OutputData , MAX_DMA_CHAIN_SIZE )) || (! crypto_dma_buff_compat (au8InputData , MAX_DMA_CHAIN_SIZE ))) {
141
+ if ((! crypto_dma_buff_compat (au8OutputData , MAX_DMA_CHAIN_SIZE )) ||
142
+ (! crypto_dma_buff_compat (au8InputData , MAX_DMA_CHAIN_SIZE ))) {
137
143
error ("Buffer for AES alter. DMA requires to be word-aligned and located in 0x20000000-0x2FFFFFFF region." );
138
144
}
139
145
Original file line number Diff line number Diff line change 26
26
#include "mbed_toolchain.h"
27
27
#include "mbed_error.h"
28
28
29
- /* DMA buffer
29
+ /* DES DMA compatible buffer requirements
30
30
*
31
- * MAXSIZE_DMABUF must be a multiple of 64-bit block size.
32
- * Its value is estimated to trade memory footprint off against performance.
31
+ * DES DMA buffer location requires to be:
32
+ * (1) Word-aligned
33
+ * (2) Located in 0x2xxxxxxx region. Check linker files to ensure global variables are placed in this region.
34
+ *
35
+ * DES DMA buffer size MAXSIZE_DMABUF must be a multiple of 64-bit block size.
36
+ * Its value is estimated to trade memory footprint off against performance.
37
+ *
33
38
*/
34
39
#define MAXSIZE_DMABUF (8 * 5)
35
40
MBED_ALIGN (4 ) static uint8_t dmabuf_in [MAXSIZE_DMABUF ];
@@ -314,7 +319,8 @@ static int mbedtls_des_docrypt(uint16_t keyopt, uint8_t key[3][MBEDTLS_DES_KEY_S
314
319
* 1) Word-aligned
315
320
* 2) Located in 0x2xxxxxxx region
316
321
*/
317
- if ((! crypto_dma_buff_compat (dmabuf_in , MAXSIZE_DMABUF )) || (! crypto_dma_buff_compat (dmabuf_out , MAXSIZE_DMABUF ))) {
322
+ if ((! crypto_dma_buff_compat (dmabuf_in , MAXSIZE_DMABUF )) ||
323
+ (! crypto_dma_buff_compat (dmabuf_out , MAXSIZE_DMABUF ))) {
318
324
error ("Buffer for DES alter. DMA requires to be word-aligned and located in 0x20000000-0x2FFFFFFF region." );
319
325
}
320
326
You can’t perform that action at this time.
0 commit comments