Skip to content

Commit 1a49760

Browse files
committed
IDF release/v3.3 44e9dd3e29
1 parent f61963d commit 1a49760

File tree

183 files changed

+57063
-69
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

183 files changed

+57063
-69
lines changed

platform.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ compiler.S.flags=-c -g3 -x assembler-with-cpp -MMD -mlongcalls
3535

3636
compiler.c.elf.cmd=xtensa-esp32-elf-gcc
3737
compiler.c.elf.flags=-nostdlib "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" -T esp32_out.ld -T esp32.project.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.rom.libgcc.ld -T esp32.rom.spiram_incompatible_fns.ld -u esp_app_desc -u ld_include_panic_highint_hdl -u call_user_start_cpu0 -Wl,--gc-sections -Wl,-static -Wl,--undefined=uxTopUsedPriority -u __cxa_guard_dummy -u __cxx_fatal_exception
38-
compiler.c.elf.libs=-lgcc -ldetection_cat_face -lespcoredump -lwpa -lrtc -lvfs -lnewlib -ldetection -lfreemodbus -lprotocomm -lwpa_supplicant -lfatfs -lsmartconfig -lesp_ringbuf -lfd -lesp_adc_cal -lspiffs -lopenssl -lsdmmc -ljsmn -lespnow -lc -lbootloader_support -lesp_https_server -lcore -lspi_flash -lmicro-ecc -lunity -lapp_trace -lexpat -lheap -ltcp_transport -lfr -lfb_gfx -lethernet -lesp_websocket_client -lesp32-camera -lcoexist -lpthread -lmqtt -lface_recognition -llwip -lasio -lefuse -lnvs_flash -lhal -lcxx -lesp_event -lfreertos -llibsodium -lwear_levelling -ljson -lesp32 -lcoap -lbt -lbtdm_app -lmbedtls -lwpa2 -lface_detection -lesp-tls -lwps -lpe -lmdns -lmesh -lesp_http_server -llog -lesp_http_client -lsoc -lc_nano -lnghttp -lprotobuf-c -lphy -lesp_https_ota -lwifi_provisioning -ldl -lulp -limage_util -lnet80211 -lsmartconfig_ack -lapp_update -lm -ltcpip_adapter -lpp -ldriver -lconsole -lod -lxtensa-debug-module -lstdc++
38+
compiler.c.elf.libs=-lgcc -lcore -lsmartconfig_ack -lwear_levelling -limage_util -lmesh -lface_detection -lsoc -lbtdm_app -lesp-tls -lesp_https_ota -lcoap -ldl -lefuse -lspiffs -lspi_flash -lpp -lethernet -lhal -lm -ltcpip_adapter -lfatfs -lwpa2 -lprotobuf-c -lmqtt -ltcp_transport -lfreemodbus -lheap -lrtc -lc_nano -llibsodium -lnewlib -lbootloader_support -ljsmn -lmbedtls -lsdmmc -lesp_websocket_client -lprotocomm -lwps -lconsole -lphy -lespcoredump -lesp_http_client -ldetection -lnghttp -lvfs -lunity -lpe -ldetection_cat_face -lwpa_supplicant -lfreertos -lespnow -lwpa -lnvs_flash -lpthread -lmicro-ecc -ljson -llog -lesp_event -lesp_http_server -lcoexist -lnet80211 -lfd -lxtensa-debug-module -lesp32-camera -lwifi_provisioning -lexpat -lapp_update -lmdns -lsmartconfig -lc -lesp32 -lface_recognition -lopenssl -lulp -lesp_ringbuf -lfr -lasio -ldriver -llwip -lfb_gfx -lbt -lesp_https_server -lcxx -lesp_adc_cal -lod -lapp_trace -lstdc++
3939

4040
compiler.as.cmd=xtensa-esp32-elf-as
4141

tools/platformio-build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170
],
171171

172172
LIBS=[
173-
"-lgcc", "-ldetection_cat_face", "-lespcoredump", "-lwpa", "-lrtc", "-lvfs", "-lnewlib", "-ldetection", "-lfreemodbus", "-lprotocomm", "-lwpa_supplicant", "-lfatfs", "-lsmartconfig", "-lesp_ringbuf", "-lfd", "-lesp_adc_cal", "-lspiffs", "-lopenssl", "-lsdmmc", "-ljsmn", "-lespnow", "-lc", "-lbootloader_support", "-lesp_https_server", "-lcore", "-lspi_flash", "-lmicro-ecc", "-lunity", "-lapp_trace", "-lexpat", "-lheap", "-ltcp_transport", "-lfr", "-lfb_gfx", "-lethernet", "-lesp_websocket_client", "-lesp32-camera", "-lcoexist", "-lpthread", "-lmqtt", "-lface_recognition", "-llwip", "-lasio", "-lefuse", "-lnvs_flash", "-lhal", "-lcxx", "-lesp_event", "-lfreertos", "-llibsodium", "-lwear_levelling", "-ljson", "-lesp32", "-lcoap", "-lbt", "-lbtdm_app", "-lmbedtls", "-lwpa2", "-lface_detection", "-lesp-tls", "-lwps", "-lpe", "-lmdns", "-lmesh", "-lesp_http_server", "-llog", "-lesp_http_client", "-lsoc", "-lc_nano", "-lnghttp", "-lprotobuf-c", "-lphy", "-lesp_https_ota", "-lwifi_provisioning", "-ldl", "-lulp", "-limage_util", "-lnet80211", "-lsmartconfig_ack", "-lapp_update", "-lm", "-ltcpip_adapter", "-lpp", "-ldriver", "-lconsole", "-lod", "-lxtensa-debug-module", "-lstdc++"
173+
"-lgcc", "-lcore", "-lsmartconfig_ack", "-lwear_levelling", "-limage_util", "-lmesh", "-lface_detection", "-lsoc", "-lbtdm_app", "-lesp-tls", "-lesp_https_ota", "-lcoap", "-ldl", "-lefuse", "-lspiffs", "-lspi_flash", "-lpp", "-lethernet", "-lhal", "-lm", "-ltcpip_adapter", "-lfatfs", "-lwpa2", "-lprotobuf-c", "-lmqtt", "-ltcp_transport", "-lfreemodbus", "-lheap", "-lrtc", "-lc_nano", "-llibsodium", "-lnewlib", "-lbootloader_support", "-ljsmn", "-lmbedtls", "-lsdmmc", "-lesp_websocket_client", "-lprotocomm", "-lwps", "-lconsole", "-lphy", "-lespcoredump", "-lesp_http_client", "-ldetection", "-lnghttp", "-lvfs", "-lunity", "-lpe", "-ldetection_cat_face", "-lwpa_supplicant", "-lfreertos", "-lespnow", "-lwpa", "-lnvs_flash", "-lpthread", "-lmicro-ecc", "-ljson", "-llog", "-lesp_event", "-lesp_http_server", "-lcoexist", "-lnet80211", "-lfd", "-lxtensa-debug-module", "-lesp32-camera", "-lwifi_provisioning", "-lexpat", "-lapp_update", "-lmdns", "-lsmartconfig", "-lc", "-lesp32", "-lface_recognition", "-lopenssl", "-lulp", "-lesp_ringbuf", "-lfr", "-lasio", "-ldriver", "-llwip", "-lfb_gfx", "-lbt", "-lesp_https_server", "-lcxx", "-lesp_adc_cal", "-lod", "-lapp_trace", "-lstdc++"
174174
],
175175

176176
LIBSOURCE_DIRS=[

tools/sdk/bin/bootloader_dio_40m.bin

16 Bytes
Binary file not shown.

tools/sdk/bin/bootloader_dio_80m.bin

16 Bytes
Binary file not shown.

tools/sdk/bin/bootloader_dout_40m.bin

16 Bytes
Binary file not shown.

tools/sdk/bin/bootloader_dout_80m.bin

16 Bytes
Binary file not shown.

tools/sdk/bin/bootloader_qio_40m.bin

16 Bytes
Binary file not shown.

tools/sdk/bin/bootloader_qio_80m.bin

16 Bytes
Binary file not shown.

tools/sdk/bin/bootloader_qout_40m.bin

16 Bytes
Binary file not shown.

tools/sdk/bin/bootloader_qout_80m.bin

16 Bytes
Binary file not shown.

tools/sdk/include/config/sdkconfig.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#define CONFIG_LWIP_ETHARP_TRUST_IP_MAC 1
1919
#define CONFIG_BLE_SCAN_DUPLICATE 1
2020
#define CONFIG_STACK_CHECK_NORM 1
21+
#define CONFIG_GC032A_SUPPORT 1
2122
#define CONFIG_TCP_WND_DEFAULT 5744
2223
#define CONFIG_PARTITION_TABLE_OFFSET 0x8000
2324
#define CONFIG_SW_COEXIST_ENABLE 1
@@ -33,6 +34,7 @@
3334
#define CONFIG_SCCB_HARDWARE_I2C_PORT1 1
3435
#define CONFIG_MBEDTLS_KEY_EXCHANGE_RSA 1
3536
#define CONFIG_UDP_RECVMBOX_SIZE 6
37+
#define CONFIG_GC0308_SUPPORT 1
3638
#define CONFIG_APP_RETRIEVE_LEN_ELF_SHA 16
3739
#define CONFIG_ARDUHAL_PARTITION_SCHEME_DEFAULT 1
3840
#define CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE 0
@@ -128,8 +130,10 @@
128130
#define CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS 4
129131
#define CONFIG_ESPTOOLPY_FLASHSIZE_DETECT 1
130132
#define CONFIG_AUTOSTART_ARDUINO 1
133+
#define CONFIG_GC_SENSOR_SUBSAMPLE_MODE 1
131134
#define CONFIG_ARDUINO_RUNNING_CORE 1
132135
#define CONFIG_ESP32_ECO3_CACHE_LOCK_FIX 1
136+
#define CONFIG_CAMERA_DMA_BUFFER_SIZE_MAX 32768
133137
#define CONFIG_PPP_CHAP_SUPPORT 1
134138
#define CONFIG_LOG_DEFAULT_LEVEL_ERROR 1
135139
#define CONFIG_TIMER_TASK_STACK_SIZE 4096
@@ -276,6 +280,7 @@
276280
#define CONFIG_ARDUINO_UDP_TASK_PRIORITY 3
277281
#define CONFIG_MBEDTLS_SSL_SESSION_TICKETS 1
278282
#define CONFIG_SPIFFS_MAX_PARTITIONS 3
283+
#define CONFIG_GC2145_SUPPORT 1
279284
#define CONFIG_ESP_ERR_TO_NAME_LOOKUP 1
280285
#define CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE_0 1
281286
#define CONFIG_MBEDTLS_SSL_RENEGOTIATION 1
@@ -397,5 +402,5 @@
397402
#define CONFIG_BTDM_MODEM_SLEEP_MODE_ORIG 1
398403
#define CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_ERROR 1
399404
#define CONFIG_FATFS_API_ENCODING_ANSI_OEM 1
400-
#define CONFIG_ARDUINO_IDF_COMMIT "b65a37795"
405+
#define CONFIG_ARDUINO_IDF_COMMIT "44e9dd3e29"
401406
#define CONFIG_ARDUINO_IDF_BRANCH "release/v3.3"

tools/sdk/include/driver/driver/spi_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ typedef struct {
8585
int sclk_io_num; ///< GPIO pin for Spi CLocK signal, or -1 if not used.
8686
int quadwp_io_num; ///< GPIO pin for WP (Write Protect) signal which is used as D2 in 4-bit communication modes, or -1 if not used.
8787
int quadhd_io_num; ///< GPIO pin for HD (HolD) signal which is used as D3 in 4-bit communication modes, or -1 if not used.
88-
int max_transfer_sz; ///< Maximum transfer size, in bytes. Defaults to 4094 if 0.
88+
int max_transfer_sz; ///< Maximum transfer size, in bytes. Defaults to 4092 if 0 when DMA enabled, or to 64 if DMA is disabled.
8989
uint32_t flags; ///< Abilities of bus to be checked by the driver. Or-ed value of ``SPICOMMON_BUSFLAG_*`` flags.
9090
int intr_flags; /**< Interrupt flag for the bus to set the priority, and IRAM attribute, see
9191
* ``esp_intr_alloc.h``. Note that the EDGE, INTRDISABLED attribute are ignored

tools/sdk/include/esp32-camera/esp_camera.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@ typedef enum {
8383
CAMERA_GRAB_LATEST /*!< Except when 1 frame buffer is used, queue will always contain the last 'fb_count' frames */
8484
} camera_grab_mode_t;
8585

86+
/**
87+
* @brief Camera frame buffer location
88+
*/
89+
typedef enum {
90+
CAMERA_FB_IN_PSRAM, /*!< Frame buffer is placed in external PSRAM */
91+
CAMERA_FB_IN_DRAM /*!< Frame buffer is placed in internal DRAM */
92+
} camera_fb_location_t;
93+
8694
/**
8795
* @brief Configuration structure for camera initialization
8896
*/
@@ -114,6 +122,7 @@ typedef struct {
114122

115123
int jpeg_quality; /*!< Quality of JPEG output. 0-63 lower means higher quality */
116124
size_t fb_count; /*!< Number of frame buffers to be allocated. If more than one, then each frame will be acquired (double speed) */
125+
camera_fb_location_t fb_location; /*!< The location where the frame buffer will be allocated */
117126
camera_grab_mode_t grab_mode; /*!< When buffers should be filled */
118127
} camera_config_t;
119128

tools/sdk/include/esp32-camera/sensor.h

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,21 @@
1111
#include <stdint.h>
1212
#include <stdbool.h>
1313

14-
// Chip ID Registers
15-
#define REG_PID 0x0A
16-
#define REG_VER 0x0B
17-
#define REG_MIDH 0x1C
18-
#define REG_MIDL 0x1D
19-
20-
#define REG16_CHIDH 0x300A
21-
#define REG16_CHIDL 0x300B
14+
#ifdef __cplusplus
15+
extern "C" {
16+
#endif
2217

2318
typedef enum {
2419
OV9650_PID = 0x96,
2520
OV7725_PID = 0x77,
2621
OV2640_PID = 0x26,
27-
OV3660_PID = 0x36,
28-
OV5640_PID = 0x56,
22+
OV3660_PID = 0x3660,
23+
OV5640_PID = 0x5640,
2924
OV7670_PID = 0x76,
30-
NT99141_PID = 0x14
25+
NT99141_PID = 0x1410,
26+
GC2145_PID = 0x2145,
27+
GC032A_PID = 0x232a,
28+
GC0308_PID = 0x9b,
3129
} camera_pid_t;
3230

3331
typedef enum {
@@ -37,18 +35,23 @@ typedef enum {
3735
CAMERA_OV5640,
3836
CAMERA_OV7670,
3937
CAMERA_NT99141,
38+
CAMERA_GC2145,
39+
CAMERA_GC032A,
40+
CAMERA_GC0308,
4041
CAMERA_MODEL_MAX,
4142
CAMERA_NONE,
42-
CAMERA_UNKNOWN
4343
} camera_model_t;
4444

4545
typedef enum {
46-
OV2640_SCCB_ADDR = 0x30,
47-
OV5640_SCCB_ADDR = 0x3C,
48-
OV3660_SCCB_ADDR = 0x3C,
49-
OV7725_SCCB_ADDR = 0x21,
50-
OV7670_SCCB_ADDR = 0x21,
51-
NT99141_SCCB_ADDR = 0x2A,
46+
OV2640_SCCB_ADDR = 0x30,// 0x60 >> 1
47+
OV5640_SCCB_ADDR = 0x3C,// 0x78 >> 1
48+
OV3660_SCCB_ADDR = 0x3C,// 0x78 >> 1
49+
OV7725_SCCB_ADDR = 0x21,// 0x42 >> 1
50+
OV7670_SCCB_ADDR = 0x21,// 0x42 >> 1
51+
NT99141_SCCB_ADDR = 0x2A,// 0x54 >> 1
52+
GC2145_SCCB_ADDR = 0x3C,// 0x78 >> 1
53+
GC032A_SCCB_ADDR = 0x21,// 0x42 >> 1
54+
GC0308_SCCB_ADDR = 0x21,// 0x42 >> 1
5255
} camera_sccb_addr_t;
5356

5457
typedef enum {
@@ -92,9 +95,11 @@ typedef enum {
9295

9396
typedef struct {
9497
const camera_model_t model;
98+
const char *name;
9599
const camera_sccb_addr_t sccb_addr;
96100
const camera_pid_t pid;
97101
const framesize_t max_size;
102+
const bool support_jpeg;
98103
} camera_sensor_info_t;
99104

100105
typedef enum {
@@ -146,7 +151,7 @@ extern const camera_sensor_info_t camera_sensor[];
146151
typedef struct {
147152
uint8_t MIDH;
148153
uint8_t MIDL;
149-
uint8_t PID;
154+
uint16_t PID;
150155
uint8_t VER;
151156
} sensor_id_t;
152157

@@ -231,4 +236,10 @@ typedef struct _sensor {
231236
int (*set_xclk) (sensor_t *sensor, int timer, int xclk);
232237
} sensor_t;
233238

239+
camera_sensor_info_t *esp_camera_sensor_get_info(sensor_id_t *id);
240+
241+
#ifdef __cplusplus
242+
}
243+
#endif
244+
234245
#endif /* __SENSOR_H__ */

tools/sdk/include/esp_event/esp_event.h

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ typedef struct {
4949
*
5050
* @return
5151
* - ESP_OK: Success
52+
* - ESP_ERR_INVALID_ARG: event_loop_args or event_loop was NULL
5253
* - ESP_ERR_NO_MEM: Cannot allocate memory for event loops list
5354
* - ESP_FAIL: Failed to create task loop
5455
* - Others: Fail
@@ -58,7 +59,7 @@ esp_err_t esp_event_loop_create(const esp_event_loop_args_t* event_loop_args, es
5859
/**
5960
* @brief Delete an existing event loop.
6061
*
61-
* @param[in] event_loop event loop to delete
62+
* @param[in] event_loop event loop to delete, must not be NULL
6263
*
6364
* @return
6465
* - ESP_OK: Success
@@ -103,7 +104,7 @@ esp_err_t esp_event_loop_delete_default();
103104
* In cases where waiting on the queue times out, ESP_OK is returned and not ESP_ERR_TIMEOUT, since it is
104105
* normal behavior.
105106
*
106-
* @param[in] event_loop event loop to dispatch posted events from
107+
* @param[in] event_loop event loop to dispatch posted events from, must not be NULL
107108
* @param[in] ticks_to_run number of ticks to run the loop
108109
*
109110
* @note encountering an unknown event that has been posted to the loop will only generate a warning, not an error.
@@ -153,7 +154,7 @@ esp_err_t esp_event_handler_register(esp_event_base_t event_base,
153154
* This function behaves in the same manner as esp_event_handler_register, except the additional
154155
* specification of the event loop to register the handler to.
155156
*
156-
* @param[in] event_loop the event loop to register this handler function to
157+
* @param[in] event_loop the event loop to register this handler function to, must not be NULL
157158
* @param[in] event_base the base id of the event to register the handler for
158159
* @param[in] event_id the id of the event to register the handler for
159160
* @param[in] event_handler the handler function which gets called when the event is dispatched
@@ -169,23 +170,23 @@ esp_err_t esp_event_handler_register(esp_event_base_t event_base,
169170
* - Others: Fail
170171
*/
171172
esp_err_t esp_event_handler_register_with(esp_event_loop_handle_t event_loop,
172-
esp_event_base_t event_base,
173-
int32_t event_id,
174-
esp_event_handler_t event_handler,
175-
void* event_handler_arg);
173+
esp_event_base_t event_base,
174+
int32_t event_id,
175+
esp_event_handler_t event_handler,
176+
void *event_handler_arg);
176177

177178
/**
178179
* @brief Unregister a handler with the system event loop.
179180
*
180-
* This function can be used to unregister a handler so that it no longer gets called during dispatch.
181-
* Handlers can be unregistered for either: (1) specific events, (2) all events of a certain event base,
182-
* or (3) all events known by the system event loop
183-
*
184-
* - specific events: specify exact event_base and event_id
185-
* - all events of a certain base: specify exact event_base and use ESP_EVENT_ANY_ID as the event_id
186-
* - all events known by the loop: use ESP_EVENT_ANY_BASE for event_base and ESP_EVENT_ANY_ID as the event_id
181+
* Unregisters a handler so it will no longer be called during dispatch.
182+
* Handlers can be unregistered for any combination of event_base and event_id which were previously registered.
183+
* To unregister a handler, the event_base and event_id arguments must match exactly the arguments passed to
184+
* esp_event_handler_register() when that handler was registered. Passing ESP_EVENT_ANY_BASE and/or ESP_EVENT_ANY_ID
185+
* will only unregister handlers that were registered with the same wildcard arguments.
187186
*
188-
* This function ignores unregistration of handlers that has not been previously registered.
187+
* @note When using ESP_EVENT_ANY_ID, handlers registered to specific event IDs using the same base will not be
188+
* unregistered. When using ESP_EVENT_ANY_BASE, events registered to specific bases will also not be
189+
* unregistered. This avoids accidental unregistration of handlers registered by other users or components.
189190
*
190191
* @param[in] event_base the base of the event with which to unregister the handler
191192
* @param[in] event_id the id of the event with which to unregister the handler
@@ -203,7 +204,7 @@ esp_err_t esp_event_handler_unregister(esp_event_base_t event_base, int32_t even
203204
* This function behaves in the same manner as esp_event_handler_unregister, except the additional specification of
204205
* the event loop to unregister the handler with.
205206
*
206-
* @param[in] event_loop the event loop with which to unregister this handler function
207+
* @param[in] event_loop the event loop with which to unregister this handler function, must not be NULL
207208
* @param[in] event_base the base of the event with which to unregister the handler
208209
* @param[in] event_id the id of the event with which to unregister the handler
209210
* @param[in] event_handler the handler to unregister
@@ -251,7 +252,7 @@ esp_err_t esp_event_post(esp_event_base_t event_base,
251252
* This function behaves in the same manner as esp_event_post_to, except the additional specification of the event loop
252253
* to post the event to.
253254
*
254-
* @param[in] event_loop the event loop to post to
255+
* @param[in] event_loop the event loop to post to, must not be NULL
255256
* @param[in] event_base the event base that identifies the event
256257
* @param[in] event_id the the event id that identifies the event
257258
* @param[in] event_data the data, specific to the event occurence, that gets passed to the handler
@@ -323,4 +324,4 @@ esp_err_t esp_event_dump(FILE* file);
323324
} // extern "C"
324325
#endif
325326

326-
#endif // #ifndef ESP_EVENT_H_
327+
#endif // #ifndef ESP_EVENT_H_

tools/sdk/include/mbedtls/mbedtls/aria.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,14 @@
8888
/* MBEDTLS_ERR_ARIA_HW_ACCEL_FAILED is deprecated and should not be used. */
8989
#define MBEDTLS_ERR_ARIA_HW_ACCEL_FAILED -0x0058 /**< ARIA hardware accelerator failed. */
9090

91-
#if !defined(MBEDTLS_ARIA_ALT)
92-
// Regular implementation
93-
//
94-
9591
#ifdef __cplusplus
9692
extern "C" {
9793
#endif
9894

95+
#if !defined(MBEDTLS_ARIA_ALT)
96+
// Regular implementation
97+
//
98+
9999
/**
100100
* \brief The ARIA context-type definition.
101101
*/

tools/sdk/include/mbedtls/mbedtls/bn_mul.h

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,46 @@
7171

7272
#include "bignum.h"
7373

74+
75+
/*
76+
* Conversion macros for embedded constants:
77+
* build lists of mbedtls_mpi_uint's from lists of unsigned char's grouped by 8, 4 or 2
78+
*/
79+
#if defined(MBEDTLS_HAVE_INT32)
80+
81+
#define MBEDTLS_BYTES_TO_T_UINT_4( a, b, c, d ) \
82+
( (mbedtls_mpi_uint) (a) << 0 ) | \
83+
( (mbedtls_mpi_uint) (b) << 8 ) | \
84+
( (mbedtls_mpi_uint) (c) << 16 ) | \
85+
( (mbedtls_mpi_uint) (d) << 24 )
86+
87+
#define MBEDTLS_BYTES_TO_T_UINT_2( a, b ) \
88+
MBEDTLS_BYTES_TO_T_UINT_4( a, b, 0, 0 )
89+
90+
#define MBEDTLS_BYTES_TO_T_UINT_8( a, b, c, d, e, f, g, h ) \
91+
MBEDTLS_BYTES_TO_T_UINT_4( a, b, c, d ), \
92+
MBEDTLS_BYTES_TO_T_UINT_4( e, f, g, h )
93+
94+
#else /* 64-bits */
95+
96+
#define MBEDTLS_BYTES_TO_T_UINT_8( a, b, c, d, e, f, g, h ) \
97+
( (mbedtls_mpi_uint) (a) << 0 ) | \
98+
( (mbedtls_mpi_uint) (b) << 8 ) | \
99+
( (mbedtls_mpi_uint) (c) << 16 ) | \
100+
( (mbedtls_mpi_uint) (d) << 24 ) | \
101+
( (mbedtls_mpi_uint) (e) << 32 ) | \
102+
( (mbedtls_mpi_uint) (f) << 40 ) | \
103+
( (mbedtls_mpi_uint) (g) << 48 ) | \
104+
( (mbedtls_mpi_uint) (h) << 56 )
105+
106+
#define MBEDTLS_BYTES_TO_T_UINT_4( a, b, c, d ) \
107+
MBEDTLS_BYTES_TO_T_UINT_8( a, b, c, d, 0, 0, 0, 0 )
108+
109+
#define MBEDTLS_BYTES_TO_T_UINT_2( a, b ) \
110+
MBEDTLS_BYTES_TO_T_UINT_8( a, b, 0, 0, 0, 0, 0, 0 )
111+
112+
#endif /* bits in mbedtls_mpi_uint */
113+
74114
#if defined(MBEDTLS_HAVE_ASM)
75115

76116
#ifndef asm

tools/sdk/include/mbedtls/mbedtls/config.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@
453453
* be overridden, but the wrapper functions mbedtls_aes_decrypt and mbedtls_aes_encrypt
454454
* must stay untouched.
455455
*
456-
* \note If you use the AES_xxx_ALT macros, then is is recommended to also set
456+
* \note If you use the AES_xxx_ALT macros, then it is recommended to also set
457457
* MBEDTLS_AES_ROM_TABLES in order to help the linker garbage-collect the AES
458458
* tables.
459459
*
@@ -1746,6 +1746,23 @@
17461746
*/
17471747
//#define MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT
17481748

1749+
/**
1750+
* \def MBEDTLS_TEST_HOOKS
1751+
*
1752+
* Enable features for invasive testing such as introspection functions and
1753+
* hooks for fault injection. This enables additional unit tests.
1754+
*
1755+
* Merely enabling this feature should not change the behavior of the product.
1756+
* It only adds new code, and new branching points where the default behavior
1757+
* is the same as when this feature is disabled.
1758+
* However, this feature increases the attack surface: there is an added
1759+
* risk of vulnerabilities, and more gadgets that can make exploits easier.
1760+
* Therefore this feature must never be enabled in production.
1761+
*
1762+
* Uncomment to enable invasive tests.
1763+
*/
1764+
//#define MBEDTLS_TEST_HOOKS
1765+
17491766
/**
17501767
* \def MBEDTLS_THREADING_ALT
17511768
*

0 commit comments

Comments
 (0)