Fix all Doxygen errors and make any future errors fatal (#118)

* Start working on fixing doxygen warnings

* Upgrade doxyfile to Doxygen 1.9.1

* Clean up some unmatched groups and add some exclusions

* Fix docs for rtos::ThisThread not showing up

* Fix up KV store docs

* Fix incorrect @files, some more incorrect groups

* Fix lots of broken links

* Start fixing mbedtls groups

* Fix more mbedtls docs

* Fix remaining mbedtls files with missing or incorrect grouping

* Fix a huge amount of PSA docs errors

* Fix a few more mbedtls docs errors

* Fix __cplusplus not defined for docs, clean up call in callback typedef, fix some docs errors

* Fix some broken doc links in HAL headers

* Fix more PSA doc errors

* Fix some doxygen errors in networking code

* Fix lots of network related doc errors

* Try and fix some CI failures

* Use Doxygen Action instead of doxygen in Mbed container to get the right version

* Try removing docs check

* Add first part of doxygen action

* Add next part of doxygen action

* Fix yaml syntax error

* Add in license check fix

* Try using verbose scancode

* Fix some more docs issues, workaround scancode-toolkit#3179

* Clean up the LoRaRadio get_state() function on each implementation.  Also fix some other compile and doc errors.

* Fix all remaining doxygen errors

* Fix escaping, for realsies this time

* Remove Doxygen unsupported config options, fix some more get_status() declarations

* Fix some UNITTESTS build errors

* Fix one more compile error

* Another unittest error
pull/15381/head
Jamie Smith 2022-12-30 18:41:41 -05:00 committed by GitHub
parent 91d1cb89fc
commit 97c267219a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
214 changed files with 1906 additions and 1426 deletions

View File

@ -26,7 +26,7 @@ jobs:
name: install dependencies name: install dependencies
shell: bash shell: bash
run: | run: |
pip install -U scancode-toolkit click gemfileparser pip install -U scancode-toolkit "click>=7,<8"
- -
name: license check name: license check
@ -42,6 +42,7 @@ jobs:
| ( grep -v '^tools/test/toolchains/api_test.py' || true ) \ | ( grep -v '^tools/test/toolchains/api_test.py' || true ) \
| while read file; do cp --parents "${file}" SCANCODE; done | while read file; do cp --parents "${file}" SCANCODE; done
ls SCANCODE ls SCANCODE
scancode --reindex-licenses # workaround for scancode-toolkit#3179
scancode -l --json-pp scancode.json SCANCODE scancode -l --json-pp scancode.json SCANCODE
python ./tools/test/ci/scancode-evaluate.py scancode.json || true python ./tools/test/ci/scancode-evaluate.py scancode.json || true
cat scancode-evaluate.log cat scancode-evaluate.log
@ -106,21 +107,7 @@ jobs:
| while read file; do astyle -n --options=.astylerc "${file}"; done | while read file; do astyle -n --options=.astylerc "${file}"; done
git diff --exit-code --diff-filter=d --color git diff --exit-code --diff-filter=d --color
- name: Spell Checks
docs-check:
runs-on: ubuntu-latest
container:
image: ghcr.io/armmbed/mbed-os-env:master-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: spell checks
run: | run: |
set -x set -x
./tools/test/ci/doxy-spellchecker/spell.sh drivers .codecheckignore ./tools/test/ci/doxy-spellchecker/spell.sh drivers .codecheckignore
@ -129,18 +116,9 @@ jobs:
./tools/test/ci/doxy-spellchecker/spell.sh rtos .codecheckignore ./tools/test/ci/doxy-spellchecker/spell.sh rtos .codecheckignore
./tools/test/ci/doxy-spellchecker/spell.sh connectivity/netsocket .codecheckignore ./tools/test/ci/doxy-spellchecker/spell.sh connectivity/netsocket .codecheckignore
- - name: File Naming Checks
name: doxygen
run: | run: |
set -x set -x
ccache -s
mkdir BUILD
# Assert that the Doxygen build produced no warnings.
# The strange command below asserts that the Doxygen command had an
# output of zero length
doxygen doxyfile_options 2>&1
# Once Mbed OS has been fixed, enable the full test by replacing the top line with this:
# - ( ! doxygen doxyfile_options 2>&1 | grep . )
# Assert that all binary libraries are named correctly # Assert that all binary libraries are named correctly
# The strange command below asserts that there are exactly 0 libraries # The strange command below asserts that there are exactly 0 libraries
# that do not start with lib # that do not start with lib
@ -153,6 +131,26 @@ jobs:
find -name "*.s" | tee BUILD/badasm | find -name "*.s" | tee BUILD/badasm |
sed -e "s/^/Bad Assembler file name found: /" && [ ! -s BUILD/badasm ] sed -e "s/^/Bad Assembler file name found: /" && [ ! -s BUILD/badasm ]
docs-check:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Create BUILD folder
run: |
mkdir -p ${{ github.workspace }}/BUILD
- name: Doxygen Action
uses: mattnotmitt/doxygen-action@v1.9.1
with:
doxyfile-path: ./doxyfile_options
python-tests: python-tests:
# these tests run in 3.7, hence running in vm not in pre-built docker # these tests run in 3.7, hence running in vm not in pre-built docker
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
with: with:
submodules: recursive submodules: recursive
@ -21,7 +21,7 @@ jobs:
# Build the HTML documentation # Build the HTML documentation
- name: Doxygen Action - name: Doxygen Action
uses: mattnotmitt/doxygen-action@v1.1.0 uses: mattnotmitt/doxygen-action@v1.9.1
with: with:
doxyfile-path: ./doxyfile_options doxyfile-path: ./doxyfile_options

View File

@ -32,13 +32,13 @@ To start a new project that uses Mbed CE, see the setup guide [here](https://git
We have a [developer website](https://os.mbed.com) for asking questions, engaging with others, finding information on boards and components, using an online IDE and compiler, reading the documentation and learning about what's new and what's coming next in Mbed OS. We have a [developer website](https://os.mbed.com) for asking questions, engaging with others, finding information on boards and components, using an online IDE and compiler, reading the documentation and learning about what's new and what's coming next in Mbed OS.
## Getting started for contributors Additionally, the [discussions page](https://github.com/mbed-ce/mbed-os/discussions) on this repo can be used for proposing and discussing specific code changes.
We also have a [contributing and publishing guide](https://os.mbed.com/contributing/) that covers licensing, contributor agreements and style guidelines.
## Documentation ## Documentation
For more information about Mbed OS, please see [our published documentation](https://os.mbed.com/docs/latest). It includes Doxygen for our APIs, step-by-step tutorials, porting information and background reference materials about our architecture and tools. For more information about Mbed OS, please see [our published documentation](https://os.mbed.com/docs/latest). It includes general overview information, step-by-step tutorials, porting information and background reference materials about our architecture and tools.
For the Mbed OS CE class-level documentation, see [here](https://mbed-ce.github.io/mbed-os/group__mbed-os-public.html)
To contribute to this documentation, please see the [mbed-os-5-docs repository](https://github.com/ARMmbed/mbed-os-5-docs). To contribute to this documentation, please see the [mbed-os-5-docs repository](https://github.com/ARMmbed/mbed-os-5-docs).

View File

@ -115,6 +115,8 @@ public:
/** /**
* Get the random static address of the controller * Get the random static address of the controller
* *
* @param[out] address MAC address is written here.
*
* @return false if the address has not been set and true otherwise. * @return false if the address has not been set and true otherwise.
*/ */
virtual bool get_random_static_address(ble::address_t& address); virtual bool get_random_static_address(ble::address_t& address);

View File

@ -205,7 +205,7 @@ public:
* command when you need multiple response parameters to be handled. * command when you need multiple response parameters to be handled.
* NOTE: Does not lock ATHandler for process! * NOTE: Does not lock ATHandler for process!
* *
* @param cmd AT command in form +<CMD> (will be used also in response reading, no extra chars allowed) * @param cmd AT command in form +&lt;CMD&lt; (will be used also in response reading, no extra chars allowed)
* @param cmd_chr Char to be added to specific AT command: '?', '=' or ''. Will be used as such so '=1' is valid as well. * @param cmd_chr Char to be added to specific AT command: '?', '=' or ''. Will be used as such so '=1' is valid as well.
* @param format Format string for variadic arguments to be added to AT command; No separator needed. * @param format Format string for variadic arguments to be added to AT command; No separator needed.
* Use %d for integer, %s for string and %b for byte string (requires 2 arguments: string and length) * Use %d for integer, %s for string and %b for byte string (requires 2 arguments: string and length)
@ -214,7 +214,7 @@ public:
/** /**
* @brief at_cmd_str Send an AT command and read a single string response. Locks and unlocks ATHandler for operation * @brief at_cmd_str Send an AT command and read a single string response. Locks and unlocks ATHandler for operation
* @param cmd AT command in form +<CMD> (will be used also in response reading, no extra chars allowed) * @param cmd AT command in form +&lt;CMD&lt; (will be used also in response reading, no extra chars allowed)
* @param cmd_chr Char to be added to specific AT command: '?', '=' or ''. Will be used as such so '=1' is valid as well. * @param cmd_chr Char to be added to specific AT command: '?', '=' or ''. Will be used as such so '=1' is valid as well.
* @param resp_buf Response buffer * @param resp_buf Response buffer
* @param resp_buf_size Response buffer size * @param resp_buf_size Response buffer size
@ -226,7 +226,7 @@ public:
/** /**
* @brief at_cmd_int Send an AT command and read a single integer response. Locks and unlocks ATHandler for operation * @brief at_cmd_int Send an AT command and read a single integer response. Locks and unlocks ATHandler for operation
* @param cmd AT command in form +<CMD> (will be used also in response reading, no extra chars allowed) * @param cmd AT command in form +&lt;CMD&lt; (will be used also in response reading, no extra chars allowed)
* @param cmd_chr Char to be added to specific AT command: '?', '=' or ''. Will be used as such so '=1' is valid as well. * @param cmd_chr Char to be added to specific AT command: '?', '=' or ''. Will be used as such so '=1' is valid as well.
* @param resp Integer to hold response * @param resp Integer to hold response
* @param format Format string for variadic arguments to be added to AT command; No separator needed. * @param format Format string for variadic arguments to be added to AT command; No separator needed.
@ -237,7 +237,7 @@ public:
/** /**
* @brief at_cmd_discard Send an AT command and read and discard a response. Locks and unlocks ATHandler for operation * @brief at_cmd_discard Send an AT command and read and discard a response. Locks and unlocks ATHandler for operation
* @param cmd AT command in form +<CMD> (will be used also in response reading, no extra chars allowed) * @param cmd AT command in form +&lt;CMD&lt; (will be used also in response reading, no extra chars allowed)
* @param cmd_chr Char to be added to specific AT command: '?', '=' or ''. Will be used as such so '=1' is valid as well. * @param cmd_chr Char to be added to specific AT command: '?', '=' or ''. Will be used as such so '=1' is valid as well.
* @param format Format string for variadic arguments to be added to AT command; No separator needed. * @param format Format string for variadic arguments to be added to AT command; No separator needed.
* Use %d for integer, %s for string and %b for byte string (requires 2 arguments: string and length) * Use %d for integer, %s for string and %b for byte string (requires 2 arguments: string and length)

View File

@ -36,7 +36,7 @@ namespace mbed {
* @ingroup mbed-os-public * @ingroup mbed-os-public
* @{ * @{
* @defgroup Cellular * @defgroup Cellular Cellular
* @ingroup connectivity-public-api * @ingroup connectivity-public-api
* @{ * @{
*/ */

View File

@ -218,8 +218,7 @@ public: //Pure virtual functions
/** Creates a new CellularContext interface. /** Creates a new CellularContext interface.
* *
* @param fh file handle used in communication to modem. This can be, for example, UART handle. If null, then the default *
* file handle is used.
* @param apn access point to use with context, can be null. * @param apn access point to use with context, can be null.
* @param cp_req flag indicating if EPS control plane optimization is required * @param cp_req flag indicating if EPS control plane optimization is required
* @param nonip_req flag indicating if this context is required to be Non-IP * @param nonip_req flag indicating if this context is required to be Non-IP
@ -297,8 +296,6 @@ public: //Pure virtual functions
/** Create new CellularNetwork interface. /** Create new CellularNetwork interface.
* *
* @param fh file handle used in communication to modem. This can be, for example, UART handle. If null, then the default
* file handle is used.
* @return New instance of interface CellularNetwork. * @return New instance of interface CellularNetwork.
*/ */
virtual CellularNetwork *open_network() = 0; virtual CellularNetwork *open_network() = 0;
@ -306,8 +303,6 @@ public: //Pure virtual functions
#if MBED_CONF_CELLULAR_USE_SMS || defined(DOXYGEN_ONLY) #if MBED_CONF_CELLULAR_USE_SMS || defined(DOXYGEN_ONLY)
/** Create new CellularSMS interface. /** Create new CellularSMS interface.
* *
* @param fh file handle used in communication to modem. This can be, for example, UART handle. If null, then the default
* file handle is used.
* @return New instance of interface CellularSMS. * @return New instance of interface CellularSMS.
*/ */
virtual CellularSMS *open_sms() = 0; virtual CellularSMS *open_sms() = 0;
@ -320,8 +315,6 @@ public: //Pure virtual functions
/** Create new CellularInformation interface. /** Create new CellularInformation interface.
* *
* @param fh file handle used in communication to modem. This can be, for example, UART handle. If null, then the default
* file handle is used.
* @return New instance of interface CellularInformation. * @return New instance of interface CellularInformation.
*/ */
virtual CellularInformation *open_information() = 0; virtual CellularInformation *open_information() = 0;

View File

@ -73,7 +73,15 @@ public:
}; };
public: public:
AT_CellularDevice(FileHandle *fh, char *delim = "\r");
/**
* Create an AT_CellularDevice.
*
* @param fh file handle used for reading AT responses and writing AT commands
* @param delim delimiter used when parsing at responses, "\r" should be used as output_delimiter
*/
AT_CellularDevice(FileHandle *fh, char const *delim = "\r");
virtual ~AT_CellularDevice(); virtual ~AT_CellularDevice();
virtual nsapi_error_t clear(); virtual nsapi_error_t clear();

View File

@ -39,7 +39,7 @@ using namespace std::chrono_literals;
#define DEFAULT_AT_TIMEOUT 1s // at default timeout #define DEFAULT_AT_TIMEOUT 1s // at default timeout
const int MAX_SIM_RESPONSE_LENGTH = 16; const int MAX_SIM_RESPONSE_LENGTH = 16;
AT_CellularDevice::AT_CellularDevice(FileHandle *fh, char *delim): AT_CellularDevice::AT_CellularDevice(FileHandle *fh, char const *delim):
CellularDevice(), CellularDevice(),
_at(fh, _queue, DEFAULT_AT_TIMEOUT, delim), _at(fh, _queue, DEFAULT_AT_TIMEOUT, delim),
#if MBED_CONF_CELLULAR_USE_SMS #if MBED_CONF_CELLULAR_USE_SMS

View File

@ -33,7 +33,7 @@ bool AT_CellularDevice_stub::pin_needed = false;
bool AT_CellularDevice_stub::supported_bool = false; bool AT_CellularDevice_stub::supported_bool = false;
int AT_CellularDevice_stub::max_sock_value = 1; int AT_CellularDevice_stub::max_sock_value = 1;
AT_CellularDevice::AT_CellularDevice(FileHandle *fh, char *delim) : AT_CellularDevice::AT_CellularDevice(FileHandle *fh, char const *delim) :
CellularDevice(), CellularDevice(),
_at(fh, _queue, get_property(AT_CellularDevice::PROPERTY_AT_SEND_DELAY), delim), _at(fh, _queue, get_property(AT_CellularDevice::PROPERTY_AT_SEND_DELAY), delim),
#if MBED_CONF_CELLULAR_USE_SMS #if MBED_CONF_CELLULAR_USE_SMS

View File

@ -48,19 +48,7 @@ public:
*/ */
virtual void start_reset_sequence(); virtual void start_reset_sequence();
/** bool get_random_static_address(ble::address_t& address) override;
* Handle HCI messages received during the reset sequence.
*
* @param msg The HCI message received.
* @note The driver should signal to the stack that the initialization
* sequence is done by calling the function: signal_reset_sequence_done.
*/
//virtual void handle_reset_sequence(uint8_t *msg);
/**
* @copydoc CordioHCIDriver::get_random_static_address
*/
virtual bool get_random_static_address(ble::address_t& address);
private: private:
/** /**

View File

@ -1269,13 +1269,18 @@ void SX126X_LoRaRadio::set_buffer_base_addr(uint8_t tx_base_addr, uint8_t rx_bas
write_opmode_command((uint8_t) RADIO_SET_BUFFERBASEADDRESS, buf, 2); write_opmode_command((uint8_t) RADIO_SET_BUFFERBASEADDRESS, buf, 2);
} }
uint8_t SX126X_LoRaRadio::get_status(void) radio_state_t SX126X_LoRaRadio::get_status(void)
{ {
if (_operation_mode != MODE_STDBY_RC || _operation_mode != MODE_SLEEP) { switch (_operation_mode) {
return 0; case MODE_TX:
return RF_TX_RUNNING;
case MODE_RX:
return RF_RX_RUNNING;
case MODE_CAD:
return RF_CAD;
default: // various standby states
return RF_IDLE;
} }
return 0xFF;
} }
int8_t SX126X_LoRaRadio::get_rssi() int8_t SX126X_LoRaRadio::get_rssi()

View File

@ -89,48 +89,13 @@ public:
*/ */
virtual void standby(void); virtual void standby(void);
/** void set_rx_config(radio_modems_t modem, uint32_t bandwidth,
* Sets the reception parameters
*
* @param modem Radio modem to be used [0: FSK, 1: LoRa]
* @param bandwidth Sets the bandwidth
* FSK : >= 2600 and <= 250000 Hz
* LoRa: [0: 125 kHz, 1: 250 kHz,
* 2: 500 kHz, 3: Reserved]
* @param datarate Sets the Datarate
* FSK : 600..300000 bits/s
* LoRa: [6: 64, 7: 128, 8: 256, 9: 512,
* 10: 1024, 11: 2048, 12: 4096 chips]
* @param coderate Sets the coding rate ( LoRa only )
* FSK : N/A ( set to 0 )
* LoRa: [1: 4/5, 2: 4/6, 3: 4/7, 4: 4/8]
* @param bandwidth_afc Sets the AFC Bandwidth ( FSK only )
* FSK : >= 2600 and <= 250000 Hz
* LoRa: N/A ( set to 0 )
* @param preamble_len Sets the Preamble length ( LoRa only )
* FSK : N/A ( set to 0 )
* LoRa: Length in symbols ( the hardware adds 4 more symbols )
* @param symb_timeout Sets the RxSingle timeout value
* FSK : timeout number of bytes
* LoRa: timeout in symbols
* @param fixLen Fixed length packets [0: variable, 1: fixed]
* @param payload_len Sets payload length when fixed lenght is used
* @param crc_on Enables/Disables the CRC [0: OFF, 1: ON]
* @param freq_hop_on Enables disables the intra-packet frequency hopping [0: OFF, 1: ON] (LoRa only)
* @param hop_period Number of symbols bewteen each hop (LoRa only)
* @param iq_inverted Inverts IQ signals ( LoRa only )
* FSK : N/A ( set to 0 )
* LoRa: [0: not inverted, 1: inverted]
* @param rx_continuous Sets the reception in continuous mode
* [false: single mode, true: continuous mode]
*/
virtual void set_rx_config(radio_modems_t modem, uint32_t bandwidth,
uint32_t datarate, uint8_t coderate, uint32_t datarate, uint8_t coderate,
uint32_t bandwidth_afc, uint16_t preamble_len, uint32_t bandwidth_afc, uint16_t preamble_len,
uint16_t symb_timeout, bool fix_len, uint16_t symb_timeout, bool fix_len,
uint8_t payload_len, uint8_t payload_len,
bool crc_on, bool freq_hop_on, uint8_t hop_period, bool crc_on, bool freq_hop_on, uint8_t hop_period,
bool iq_inverted, bool rx_continuous); bool iq_inverted, bool rx_continuous) override;
/** /**
* Sets the transmission parameters * Sets the transmission parameters
@ -204,13 +169,7 @@ public:
*/ */
virtual uint32_t random(void); virtual uint32_t random(void);
/** radio_state_t get_status(void) override;
* Get radio status
*
* @param status Radio status [RF_IDLE, RF_RX_RUNNING, RF_TX_RUNNING]
* @return Return current radio status
*/
virtual uint8_t get_status(void);
/** /**
* Sets the maximum payload length * Sets the maximum payload length

View File

@ -1,9 +1,9 @@
/*! /*!
* \file sx126x.h * \file sx126x_ds.h
* *
* \brief SX126x driver implementation * \brief SX126x driver implementation
* *
* \copyright Revised BSD License, see section \ref LICENSE. * \copyright Revised BSD License
* *
* \code * \code
* ______ _ * ______ _

View File

@ -113,48 +113,13 @@ public:
*/ */
virtual void standby(void); virtual void standby(void);
/** void set_rx_config(radio_modems_t modem, uint32_t bandwidth,
* Sets the reception parameters
*
* @param modem Radio modem to be used [0: FSK, 1: LoRa]
* @param bandwidth Sets the bandwidth
* FSK : >= 2600 and <= 250000 Hz
* LoRa: [0: 125 kHz, 1: 250 kHz,
* 2: 500 kHz, 3: Reserved]
* @param datarate Sets the Datarate
* FSK : 600..300000 bits/s
* LoRa: [6: 64, 7: 128, 8: 256, 9: 512,
* 10: 1024, 11: 2048, 12: 4096 chips]
* @param coderate Sets the coding rate ( LoRa only )
* FSK : N/A ( set to 0 )
* LoRa: [1: 4/5, 2: 4/6, 3: 4/7, 4: 4/8]
* @param bandwidth_afc Sets the AFC Bandwidth ( FSK only )
* FSK : >= 2600 and <= 250000 Hz
* LoRa: N/A ( set to 0 )
* @param preamble_len Sets the Preamble length ( LoRa only )
* FSK : N/A ( set to 0 )
* LoRa: Length in symbols ( the hardware adds 4 more symbols )
* @param symb_timeout Sets the RxSingle timeout value
* FSK : timeout number of bytes
* LoRa: timeout in symbols
* @param fixLen Fixed length packets [0: variable, 1: fixed]
* @param payload_len Sets payload length when fixed lenght is used
* @param crc_on Enables/Disables the CRC [0: OFF, 1: ON]
* @param freq_hop_on Enables disables the intra-packet frequency hopping [0: OFF, 1: ON] (LoRa only)
* @param hop_period Number of symbols bewteen each hop (LoRa only)
* @param iq_inverted Inverts IQ signals ( LoRa only )
* FSK : N/A ( set to 0 )
* LoRa: [0: not inverted, 1: inverted]
* @param rx_continuous Sets the reception in continuous mode
* [false: single mode, true: continuous mode]
*/
virtual void set_rx_config(radio_modems_t modem, uint32_t bandwidth,
uint32_t datarate, uint8_t coderate, uint32_t datarate, uint8_t coderate,
uint32_t bandwidth_afc, uint16_t preamble_len, uint32_t bandwidth_afc, uint16_t preamble_len,
uint16_t symb_timeout, bool fix_len, uint16_t symb_timeout, bool fix_len,
uint8_t payload_len, uint8_t payload_len,
bool crc_on, bool freq_hop_on, uint8_t hop_period, bool crc_on, bool freq_hop_on, uint8_t hop_period,
bool iq_inverted, bool rx_continuous); bool iq_inverted, bool rx_continuous) override;
/** /**
* Sets the transmission parameters * Sets the transmission parameters
@ -237,13 +202,7 @@ public:
*/ */
virtual uint32_t random(void); virtual uint32_t random(void);
/** radio_state_t get_status(void) override;
* Get radio status
*
* @param status Radio status [RF_IDLE, RF_RX_RUNNING, RF_TX_RUNNING]
* @return Return current radio status
*/
virtual uint8_t get_status(void);
/** /**
* Sets the maximum payload length * Sets the maximum payload length

View File

@ -128,48 +128,13 @@ public:
*/ */
virtual void standby(void); virtual void standby(void);
/** void set_rx_config(radio_modems_t modem, uint32_t bandwidth,
* Sets the reception parameters
*
* @param modem Radio modem to be used [0: FSK, 1: LoRa]
* @param bandwidth Sets the bandwidth
* FSK : >= 2600 and <= 250000 Hz
* LoRa: [0: 125 kHz, 1: 250 kHz,
* 2: 500 kHz, 3: Reserved]
* @param datarate Sets the Datarate
* FSK : 600..300000 bits/s
* LoRa: [6: 64, 7: 128, 8: 256, 9: 512,
* 10: 1024, 11: 2048, 12: 4096 chips]
* @param coderate Sets the coding rate ( LoRa only )
* FSK : N/A ( set to 0 )
* LoRa: [1: 4/5, 2: 4/6, 3: 4/7, 4: 4/8]
* @param bandwidth_afc Sets the AFC Bandwidth ( FSK only )
* FSK : >= 2600 and <= 250000 Hz
* LoRa: N/A ( set to 0 )
* @param preamble_len Sets the Preamble length ( LoRa only )
* FSK : N/A ( set to 0 )
* LoRa: Length in symbols ( the hardware adds 4 more symbols )
* @param symb_timeout Sets the RxSingle timeout value
* FSK : timeout number of bytes
* LoRa: timeout in symbols
* @param fixLen Fixed length packets [0: variable, 1: fixed]
* @param payload_len Sets payload length when fixed lenght is used
* @param crc_on Enables/Disables the CRC [0: OFF, 1: ON]
* @param freq_hop_on Enables disables the intra-packet frequency hopping [0: OFF, 1: ON] (LoRa only)
* @param hop_period Number of symbols bewteen each hop (LoRa only)
* @param iq_inverted Inverts IQ signals ( LoRa only )
* FSK : N/A ( set to 0 )
* LoRa: [0: not inverted, 1: inverted]
* @param rx_continuous Sets the reception in continuous mode
* [false: single mode, true: continuous mode]
*/
virtual void set_rx_config(radio_modems_t modem, uint32_t bandwidth,
uint32_t datarate, uint8_t coderate, uint32_t datarate, uint8_t coderate,
uint32_t bandwidth_afc, uint16_t preamble_len, uint32_t bandwidth_afc, uint16_t preamble_len,
uint16_t symb_timeout, bool fix_len, uint16_t symb_timeout, bool fix_len,
uint8_t payload_len, uint8_t payload_len,
bool crc_on, bool freq_hop_on, uint8_t hop_period, bool crc_on, bool freq_hop_on, uint8_t hop_period,
bool iq_inverted, bool rx_continuous); bool iq_inverted, bool rx_continuous) override;
/** /**
* Sets the transmission parameters * Sets the transmission parameters
@ -252,13 +217,7 @@ public:
*/ */
virtual uint32_t random(void); virtual uint32_t random(void);
/** radio_state_t get_status(void) override;
* Get radio status
*
* @param status Radio status [RF_IDLE, RF_RX_RUNNING, RF_TX_RUNNING]
* @return Return current radio status
*/
virtual uint8_t get_status(void);
/** /**
* Sets the maximum payload length * Sets the maximum payload length

View File

@ -1401,7 +1401,7 @@ void STM32WL_LoRaRadio::set_buffer_base_addr(uint8_t tx_base_addr, uint8_t rx_ba
write_opmode_command((uint8_t) RADIO_SET_BUFFERBASEADDRESS, buf, 2); write_opmode_command((uint8_t) RADIO_SET_BUFFERBASEADDRESS, buf, 2);
} }
uint8_t STM32WL_LoRaRadio::get_status(void) radio_state_t STM32WL_LoRaRadio::get_status(void)
{ {
DEBUG_PRINTF("STM32WL_LoRaRadio::get_status\n"); DEBUG_PRINTF("STM32WL_LoRaRadio::get_status\n");
switch (_operating_mode) { switch (_operating_mode) {

View File

@ -1,4 +1,4 @@
/** /*
/ _____) _ | | / _____) _ | |
( (____ _____ ____ _| |_ _____ ____| |__ ( (____ _____ ____ _| |_ _____ ____| |__
\____ \| ___ | (_ _) ___ |/ ___) _ \ \____ \| ___ | (_ _) ___ |/ ___) _ \
@ -83,48 +83,13 @@ public:
*/ */
virtual void standby(void); virtual void standby(void);
/** void set_rx_config(radio_modems_t modem, uint32_t bandwidth,
* Sets the reception parameters
*
* @param modem Radio modem to be used [0: FSK, 1: LoRa]
* @param bandwidth Sets the bandwidth
* FSK : >= 2600 and <= 250000 Hz
* LoRa: [0: 125 kHz, 1: 250 kHz,
* 2: 500 kHz, 3: Reserved]
* @param datarate Sets the Datarate
* FSK : 600..300000 bits/s
* LoRa: [6: 64, 7: 128, 8: 256, 9: 512,
* 10: 1024, 11: 2048, 12: 4096 chips]
* @param coderate Sets the coding rate ( LoRa only )
* FSK : N/A ( set to 0 )
* LoRa: [1: 4/5, 2: 4/6, 3: 4/7, 4: 4/8]
* @param bandwidth_afc Sets the AFC Bandwidth ( FSK only )
* FSK : >= 2600 and <= 250000 Hz
* LoRa: N/A ( set to 0 )
* @param preamble_len Sets the Preamble length ( LoRa only )
* FSK : N/A ( set to 0 )
* LoRa: Length in symbols ( the hardware adds 4 more symbols )
* @param symb_timeout Sets the RxSingle timeout value
* FSK : timeout number of bytes
* LoRa: timeout in symbols
* @param fixLen Fixed length packets [0: variable, 1: fixed]
* @param payload_len Sets payload length when fixed lenght is used
* @param crc_on Enables/Disables the CRC [0: OFF, 1: ON]
* @param freq_hop_on Enables disables the intra-packet frequency hopping [0: OFF, 1: ON] (LoRa only)
* @param hop_period Number of symbols bewteen each hop (LoRa only)
* @param iq_inverted Inverts IQ signals ( LoRa only )
* FSK : N/A ( set to 0 )
* LoRa: [0: not inverted, 1: inverted]
* @param rx_continuous Sets the reception in continuous mode
* [false: single mode, true: continuous mode]
*/
virtual void set_rx_config(radio_modems_t modem, uint32_t bandwidth,
uint32_t datarate, uint8_t coderate, uint32_t datarate, uint8_t coderate,
uint32_t bandwidth_afc, uint16_t preamble_len, uint32_t bandwidth_afc, uint16_t preamble_len,
uint16_t symb_timeout, bool fix_len, uint16_t symb_timeout, bool fix_len,
uint8_t payload_len, uint8_t payload_len,
bool crc_on, bool freq_hop_on, uint8_t hop_period, bool crc_on, bool freq_hop_on, uint8_t hop_period,
bool iq_inverted, bool rx_continuous); bool iq_inverted, bool rx_continuous) override;
/** /**
* Sets the transmission parameters * Sets the transmission parameters
@ -207,13 +172,7 @@ public:
*/ */
virtual uint32_t random(void); virtual uint32_t random(void);
/** radio_state_t get_status(void) override;
* Get radio status
*
* @param status Radio status [RF_IDLE, RF_RX_RUNNING, RF_TX_RUNNING]
* @return Return current radio status
*/
virtual uint8_t get_status(void);
/** /**
* Sets the maximum payload length * Sets the maximum payload length

View File

@ -18,7 +18,7 @@
*/ */
/** /**
* \file ecp.h * \file
* \version 1.0 * \version 1.0
* *
* \brief This file provides an API for Elliptic Curves over GF(P) (ECP). * \brief This file provides an API for Elliptic Curves over GF(P) (ECP).

View File

@ -1,5 +1,5 @@
/** /**
* \file sha1.h * \file
* *
* \brief SHA-1 cryptographic hash function * \brief SHA-1 cryptographic hash function
* *

View File

@ -1,5 +1,5 @@
/** /**
* \file sha256.h * \file sha256_alt_sw.h
* *
* \brief SHA-224 and SHA-256 cryptographic hash function * \brief SHA-224 and SHA-256 cryptographic hash function
* *

View File

@ -1,5 +1,5 @@
/** /**
* \file sha512.h * \file sha512_alt_sw.h
* *
* \brief SHA-384 and SHA-512 cryptographic hash function * \brief SHA-384 and SHA-512 cryptographic hash function
* *

View File

@ -1,5 +1,5 @@
/** /**
* \file sha1.h * \file
* *
* \brief SHA-1 cryptographic hash function * \brief SHA-1 cryptographic hash function
* *

View File

@ -1,5 +1,5 @@
/** /**
* \file sha256.h * \file sha256_alt_sw.h
* *
* \brief SHA-224 and SHA-256 cryptographic hash function * \brief SHA-224 and SHA-256 cryptographic hash function
* *

View File

@ -1,5 +1,5 @@
/** /**
* \file ccm.h * \file ccm_alt.h
* *
* \brief This file provides an API for the CCM authenticated encryption * \brief This file provides an API for the CCM authenticated encryption
* mode for block ciphers. * mode for block ciphers.

View File

@ -1,5 +1,5 @@
/** /**
* \file gcm_alt.h.h * \file gcm_alt.h
* *
* \brief This file contains GCM definitions and functions. * \brief This file contains GCM definitions and functions.
* *

View File

@ -1,5 +1,5 @@
/** /**
* \file md5.h * \file
* *
* \brief MD5 message digest algorithm (hash function) * \brief MD5 message digest algorithm (hash function)
* *

View File

@ -1,5 +1,5 @@
/** /**
* \file sha1.h * \file
* *
* \brief This file contains SHA-1 definitions and functions. * \brief This file contains SHA-1 definitions and functions.
* *

View File

@ -1,5 +1,5 @@
/** /**
* \file sha256.h * \file sha256_alt.h
* *
* \brief This file contains SHA-224 and SHA-256 definitions and functions. * \brief This file contains SHA-224 and SHA-256 definitions and functions.
* *

View File

@ -225,9 +225,6 @@ enum Communication_t {
* In async mode each function call returns immediately and the answer will be notified * In async mode each function call returns immediately and the answer will be notified
* through a callback. * through a callback.
* The default behaviour is sync mode. * The default behaviour is sync mode.
* To enable the async mode ManageI2CGPO(I2C_ANSWER_READY) function must be called.
* When the component notifies an interrupt user must call {@link ManageEvent} function.
* Note that passing a parameter other than I2C_ANSWER_READY to ManageI2CGPO initialize the component in sync mode.
*/ */
class M24srDriver : public NFCEEPROMDriver { class M24srDriver : public NFCEEPROMDriver {
public: public:

View File

@ -67,19 +67,7 @@ public:
*/ */
virtual uint8_t get_hwaddr_size() const; virtual uint8_t get_hwaddr_size() const;
/** bool get_hwaddr(uint8_t *addr) const override;
* Return interface-supplied HW address
*
* Copies HW address to provided memory, @param addr has to be of correct size see @a get_hwaddr_size
*
* HW address need not be provided if this interface does not have its own HW
* address configuration; stack will choose address from central system
* configuration if the function returns false and does not write to addr.
*
* @param addr HW address for underlying interface
* @return true if HW address is available
*/
virtual bool get_hwaddr(uint8_t *addr) const;
/** /**
* Set HW address for interface * Set HW address for interface

View File

@ -62,19 +62,7 @@ public:
*/ */
virtual uint8_t get_hwaddr_size() const; virtual uint8_t get_hwaddr_size() const;
/** bool get_hwaddr(uint8_t *addr) const override;
* Return interface-supplied HW address
*
* Copies HW address to provided memory, @param addr has to be of correct size see @a get_hwaddr_size
*
* HW address need not be provided if this interface does not have its own HW
* address configuration; stack will choose address from central system
* configuration if the function returns false and does not write to addr.
*
* @param addr HW address for underlying interface
* @return true if HW address is available
*/
virtual bool get_hwaddr(uint8_t *addr) const;
/** /**
* Set HW address for interface * Set HW address for interface

View File

@ -79,14 +79,6 @@ public:
*/ */
void get_ifname(char *name, uint8_t size) const override; void get_ifname(char *name, uint8_t size) const override;
/**
* Sends the packet over the link
*
* That cannot be called from an interrupt context.
*
* @param buf Packet to be send
* @return True if the packet was send successfully, false otherwise
*/
bool link_out(net_stack_mem_buf_t *buf, nsapi_ip_stack_t ip_stack) override; bool link_out(net_stack_mem_buf_t *buf, nsapi_ip_stack_t ip_stack) override;
/** /**

View File

@ -580,9 +580,9 @@ public:
/** /**
* Gets the radio status. * Gets the radio status.
* *
* @return The current radio status. * @return The current radio status (#RF_IDLE, #RF_RX_RUNNING, #RF_TX_RUNNING, etc.)
*/ */
virtual uint8_t get_status(void) = 0; virtual radio_state_t get_status(void) = 0;
/** /**
* Sets the maximum payload length. * Sets the maximum payload length.

View File

@ -91,9 +91,9 @@ public:
return 4; return 4;
}; };
virtual uint8_t get_status(void) radio_state_t get_status(void) override
{ {
return uint8_value; return static_cast<radio_state_t>(uint8_value);
}; };
virtual void set_max_payload_length(radio_modems_t modem, uint8_t max) virtual void set_max_payload_length(radio_modems_t modem, uint8_t max)

View File

@ -74,9 +74,9 @@ public:
return 4; return 4;
}; };
virtual uint8_t get_status(void) radio_state_t get_status(void) override
{ {
return uint8_value; return static_cast<radio_state_t>(uint8_value);
}; };
virtual void set_max_payload_length(radio_modems_t modem, uint8_t max) virtual void set_max_payload_length(radio_modems_t modem, uint8_t max)

View File

@ -74,9 +74,9 @@ public:
return 4; return 4;
}; };
virtual uint8_t get_status(void) radio_state_t get_status(void) override
{ {
return uint8_value; return static_cast<radio_state_t>(uint8_value);
}; };
virtual void set_max_payload_length(radio_modems_t modem, uint8_t max) virtual void set_max_payload_length(radio_modems_t modem, uint8_t max)

View File

@ -74,9 +74,9 @@ public:
return 4; return 4;
}; };
virtual uint8_t get_status(void) radio_state_t get_status(void) override
{ {
return uint8_value; return static_cast<radio_state_t>(uint8_value);
}; };
virtual void set_max_payload_length(radio_modems_t modem, uint8_t max) virtual void set_max_payload_length(radio_modems_t modem, uint8_t max)

View File

@ -74,9 +74,9 @@ public:
return 4; return 4;
}; };
virtual uint8_t get_status(void) radio_state_t get_status(void) override
{ {
return 0; return RF_IDLE;
}; };
virtual void set_max_payload_length(radio_modems_t modem, uint8_t max) virtual void set_max_payload_length(radio_modems_t modem, uint8_t max)

View File

@ -74,9 +74,9 @@ public:
return 4; return 4;
}; };
virtual uint8_t get_status(void) radio_state_t get_status(void) override
{ {
return uint8_value; return static_cast<radio_state_t>(uint8_value);
}; };
virtual void set_max_payload_length(radio_modems_t modem, uint8_t max) virtual void set_max_payload_length(radio_modems_t modem, uint8_t max)

View File

@ -73,9 +73,9 @@ public:
return 4; return 4;
}; };
virtual uint8_t get_status(void) radio_state_t get_status(void) override
{ {
return 0; return RF_IDLE;
}; };
virtual void set_max_payload_length(radio_modems_t modem, uint8_t max) virtual void set_max_payload_length(radio_modems_t modem, uint8_t max)

View File

@ -100,9 +100,9 @@ public:
return 4; return 4;
}; };
virtual uint8_t get_status(void) radio_state_t get_status(void) override
{ {
return uint8_value; return static_cast<radio_state_t>(uint8_value);
}; };
virtual void set_max_payload_length(radio_modems_t modem, uint8_t max) virtual void set_max_payload_length(radio_modems_t modem, uint8_t max)

View File

@ -137,20 +137,8 @@ public:
*/ */
nsapi_error_t get_ipv6_link_local_address(SocketAddress *address) override; nsapi_error_t get_ipv6_link_local_address(SocketAddress *address) override;
/** Copies netmask of the network interface to user supplied buffer
*
* @param buf buffer to which netmask will be copied as "W:X:Y:Z"
* @param buflen size of supplied buffer
* @return Pointer to a buffer, or NULL if the buffer is too small
*/
nsapi_error_t get_netmask(SocketAddress *address) override; nsapi_error_t get_netmask(SocketAddress *address) override;
/** Copies gateway address of the network interface to user supplied buffer
*
* @param buf buffer to which gateway address will be copied as "W:X:Y:Z"
* @param buflen size of supplied buffer
* @return Pointer to a buffer, or NULL if the buffer is too small
*/
nsapi_error_t get_gateway(SocketAddress *address) override; nsapi_error_t get_gateway(SocketAddress *address) override;
private: private:

View File

@ -49,6 +49,13 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_aes_module AES
* \{
*/
/* padlock.c and aesni.c rely on these values! */ /* padlock.c and aesni.c rely on these values! */
#define MBEDTLS_AES_ENCRYPT 1 /**< AES encryption. */ #define MBEDTLS_AES_ENCRYPT 1 /**< AES encryption. */
#define MBEDTLS_AES_DECRYPT 0 /**< AES decryption. */ #define MBEDTLS_AES_DECRYPT 0 /**< AES decryption. */
@ -654,6 +661,8 @@ MBEDTLS_DEPRECATED void mbedtls_aes_decrypt( mbedtls_aes_context *ctx,
#undef MBEDTLS_DEPRECATED #undef MBEDTLS_DEPRECATED
#endif /* !MBEDTLS_DEPRECATED_REMOVED */ #endif /* !MBEDTLS_DEPRECATED_REMOVED */
/// \}
/// \}
#if defined(MBEDTLS_SELF_TEST) #if defined(MBEDTLS_SELF_TEST)
/** /**

View File

@ -34,6 +34,13 @@
#include <stddef.h> #include <stddef.h>
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_arc4_module ARC4
* \{
*/
/* MBEDTLS_ERR_ARC4_HW_ACCEL_FAILED is deprecated and should not be used. */ /* MBEDTLS_ERR_ARC4_HW_ACCEL_FAILED is deprecated and should not be used. */
#define MBEDTLS_ERR_ARC4_HW_ACCEL_FAILED -0x0019 /**< ARC4 hardware accelerator failed. */ #define MBEDTLS_ERR_ARC4_HW_ACCEL_FAILED -0x0019 /**< ARC4 hardware accelerator failed. */
@ -121,6 +128,9 @@ void mbedtls_arc4_setup( mbedtls_arc4_context *ctx, const unsigned char *key,
int mbedtls_arc4_crypt( mbedtls_arc4_context *ctx, size_t length, const unsigned char *input, int mbedtls_arc4_crypt( mbedtls_arc4_context *ctx, size_t length, const unsigned char *input,
unsigned char *output ); unsigned char *output );
/// \}
/// \}
#if defined(MBEDTLS_SELF_TEST) #if defined(MBEDTLS_SELF_TEST)
/** /**

View File

@ -40,6 +40,13 @@
#include "mbedtls/platform_util.h" #include "mbedtls/platform_util.h"
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_aria_module ARIA
* \{
*/
#define MBEDTLS_ARIA_ENCRYPT 1 /**< ARIA encryption. */ #define MBEDTLS_ARIA_ENCRYPT 1 /**< ARIA encryption. */
#define MBEDTLS_ARIA_DECRYPT 0 /**< ARIA decryption. */ #define MBEDTLS_ARIA_DECRYPT 0 /**< ARIA decryption. */
@ -353,6 +360,9 @@ int mbedtls_aria_crypt_ctr( mbedtls_aria_context *ctx,
unsigned char *output ); unsigned char *output );
#endif /* MBEDTLS_CIPHER_MODE_CTR */ #endif /* MBEDTLS_CIPHER_MODE_CTR */
/// \}
/// \}
#if defined(MBEDTLS_SELF_TEST) #if defined(MBEDTLS_SELF_TEST)
/** /**
* \brief Checkup routine. * \brief Checkup routine.

View File

@ -35,7 +35,9 @@
#endif #endif
/** /**
* \addtogroup asn1_module * \addtogroup mbedtls
* \{
* \defgroup mbedtls_asn1_module ASN.1
* \{ * \{
*/ */
@ -54,7 +56,7 @@
#define MBEDTLS_ERR_ASN1_ALLOC_FAILED -0x006A /**< Memory allocation failed */ #define MBEDTLS_ERR_ASN1_ALLOC_FAILED -0x006A /**< Memory allocation failed */
#define MBEDTLS_ERR_ASN1_BUF_TOO_SMALL -0x006C /**< Buffer too small when writing ASN.1 data structure. */ #define MBEDTLS_ERR_ASN1_BUF_TOO_SMALL -0x006C /**< Buffer too small when writing ASN.1 data structure. */
/* \} name */ /** \} name */
/** /**
* \name DER constants * \name DER constants
@ -67,26 +69,26 @@
* Such sequences are typically read into \c ::mbedtls_x509_buf. * Such sequences are typically read into \c ::mbedtls_x509_buf.
* \{ * \{
*/ */
#define MBEDTLS_ASN1_BOOLEAN 0x01 #define MBEDTLS_ASN1_BOOLEAN 0x01 ///< Boolean
#define MBEDTLS_ASN1_INTEGER 0x02 #define MBEDTLS_ASN1_INTEGER 0x02 ///< Integer
#define MBEDTLS_ASN1_BIT_STRING 0x03 #define MBEDTLS_ASN1_BIT_STRING 0x03 ///< Bit String
#define MBEDTLS_ASN1_OCTET_STRING 0x04 #define MBEDTLS_ASN1_OCTET_STRING 0x04 ///< Octet String
#define MBEDTLS_ASN1_NULL 0x05 #define MBEDTLS_ASN1_NULL 0x05 ///< Null
#define MBEDTLS_ASN1_OID 0x06 #define MBEDTLS_ASN1_OID 0x06 ///< OID
#define MBEDTLS_ASN1_ENUMERATED 0x0A #define MBEDTLS_ASN1_ENUMERATED 0x0A ///< Enumerated
#define MBEDTLS_ASN1_UTF8_STRING 0x0C #define MBEDTLS_ASN1_UTF8_STRING 0x0C ///< UTF-8 String
#define MBEDTLS_ASN1_SEQUENCE 0x10 #define MBEDTLS_ASN1_SEQUENCE 0x10 ///< Sequence
#define MBEDTLS_ASN1_SET 0x11 #define MBEDTLS_ASN1_SET 0x11 ///< Set
#define MBEDTLS_ASN1_PRINTABLE_STRING 0x13 #define MBEDTLS_ASN1_PRINTABLE_STRING 0x13 ///< Printable String
#define MBEDTLS_ASN1_T61_STRING 0x14 #define MBEDTLS_ASN1_T61_STRING 0x14 ///< T61 String
#define MBEDTLS_ASN1_IA5_STRING 0x16 #define MBEDTLS_ASN1_IA5_STRING 0x16 ///< IA5 String
#define MBEDTLS_ASN1_UTC_TIME 0x17 #define MBEDTLS_ASN1_UTC_TIME 0x17 ///< UTC Time
#define MBEDTLS_ASN1_GENERALIZED_TIME 0x18 #define MBEDTLS_ASN1_GENERALIZED_TIME 0x18 ///< Generalized Time
#define MBEDTLS_ASN1_UNIVERSAL_STRING 0x1C #define MBEDTLS_ASN1_UNIVERSAL_STRING 0x1C ///< Universal String
#define MBEDTLS_ASN1_BMP_STRING 0x1E #define MBEDTLS_ASN1_BMP_STRING 0x1E ///< BMP String
#define MBEDTLS_ASN1_PRIMITIVE 0x00 #define MBEDTLS_ASN1_PRIMITIVE 0x00 ///< Primitive
#define MBEDTLS_ASN1_CONSTRUCTED 0x20 #define MBEDTLS_ASN1_CONSTRUCTED 0x20 ///< Constructed
#define MBEDTLS_ASN1_CONTEXT_SPECIFIC 0x80 #define MBEDTLS_ASN1_CONTEXT_SPECIFIC 0x80 ///< Context Specific
/* Slightly smaller way to check if tag is a string tag /* Slightly smaller way to check if tag is a string tag
* compared to canonical implementation. */ * compared to canonical implementation. */
@ -114,8 +116,7 @@
#define MBEDTLS_ASN1_TAG_PC_MASK 0x20 #define MBEDTLS_ASN1_TAG_PC_MASK 0x20
#define MBEDTLS_ASN1_TAG_VALUE_MASK 0x1F #define MBEDTLS_ASN1_TAG_VALUE_MASK 0x1F
/* \} name */ /** \} name */
/* \} addtogroup asn1_module */
/** Returns the size of the binary string, without the trailing \\0 */ /** Returns the size of the binary string, without the trailing \\0 */
#define MBEDTLS_OID_SIZE(x) (sizeof(x) - 1) #define MBEDTLS_OID_SIZE(x) (sizeof(x) - 1)
@ -138,11 +139,6 @@
extern "C" { extern "C" {
#endif #endif
/**
* \name Functions to parse ASN.1 data structures
* \{
*/
/** /**
* Type-length-value structure that allows for ASN1 using DER. * Type-length-value structure that allows for ASN1 using DER.
*/ */
@ -187,6 +183,7 @@ typedef struct mbedtls_asn1_named_data
} }
mbedtls_asn1_named_data; mbedtls_asn1_named_data;
/** /**
* \brief Get the length of an ASN.1 element. * \brief Get the length of an ASN.1 element.
* Updates the pointer to immediately behind the length. * Updates the pointer to immediately behind the length.
@ -604,4 +601,7 @@ void mbedtls_asn1_free_named_data_list( mbedtls_asn1_named_data **head );
} }
#endif #endif
/// \}
/// \}
#endif /* asn1.h */ #endif /* asn1.h */

View File

@ -30,6 +30,13 @@
#include "mbedtls/asn1.h" #include "mbedtls/asn1.h"
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_asn1write_module ASN.1 Write
* \{
*/
#define MBEDTLS_ASN1_CHK_ADD(g, f) \ #define MBEDTLS_ASN1_CHK_ADD(g, f) \
do \ do \
{ \ { \
@ -363,6 +370,9 @@ mbedtls_asn1_named_data *mbedtls_asn1_store_named_data( mbedtls_asn1_named_data
const unsigned char *val, const unsigned char *val,
size_t val_len ); size_t val_len );
/// \}
/// \}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -30,6 +30,13 @@
#include <stddef.h> #include <stddef.h>
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_base64_module Base64
* \{
*/
#define MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL -0x002A /**< Output buffer too small. */ #define MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL -0x002A /**< Output buffer too small. */
#define MBEDTLS_ERR_BASE64_INVALID_CHARACTER -0x002C /**< Invalid character in input. */ #define MBEDTLS_ERR_BASE64_INVALID_CHARACTER -0x002C /**< Invalid character in input. */
@ -79,6 +86,9 @@ int mbedtls_base64_encode( unsigned char *dst, size_t dlen, size_t *olen,
int mbedtls_base64_decode( unsigned char *dst, size_t dlen, size_t *olen, int mbedtls_base64_decode( unsigned char *dst, size_t dlen, size_t *olen,
const unsigned char *src, size_t slen ); const unsigned char *src, size_t slen );
/// \}
/// \}
#if defined(MBEDTLS_SELF_TEST) #if defined(MBEDTLS_SELF_TEST)
/** /**
* \brief Checkup routine * \brief Checkup routine

View File

@ -33,8 +33,15 @@
#include "mbedtls/platform_util.h" #include "mbedtls/platform_util.h"
#define MBEDTLS_BLOWFISH_ENCRYPT 1 /**
#define MBEDTLS_BLOWFISH_DECRYPT 0 * \addtogroup mbedtls
* \{
* \defgroup mbedtls_blowfish_module Blowfish
* \{
*/
#define MBEDTLS_BLOWFISH_ENCRYPT 1 ///< Constant to select blowfish encryption
#define MBEDTLS_BLOWFISH_DECRYPT 0 ///< Constant to select blowfish decryption
#define MBEDTLS_BLOWFISH_MAX_KEY_BITS 448 #define MBEDTLS_BLOWFISH_MAX_KEY_BITS 448
#define MBEDTLS_BLOWFISH_MIN_KEY_BITS 32 #define MBEDTLS_BLOWFISH_MIN_KEY_BITS 32
#define MBEDTLS_BLOWFISH_ROUNDS 16 /**< Rounds to use. When increasing this value, make sure to extend the initialisation vectors */ #define MBEDTLS_BLOWFISH_ROUNDS 16 /**< Rounds to use. When increasing this value, make sure to extend the initialisation vectors */
@ -278,6 +285,9 @@ int mbedtls_blowfish_crypt_ctr( mbedtls_blowfish_context *ctx,
unsigned char *output ); unsigned char *output );
#endif /* MBEDTLS_CIPHER_MODE_CTR */ #endif /* MBEDTLS_CIPHER_MODE_CTR */
/// \}
/// \}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -33,8 +33,15 @@
#include "mbedtls/platform_util.h" #include "mbedtls/platform_util.h"
#define MBEDTLS_CAMELLIA_ENCRYPT 1 /**
#define MBEDTLS_CAMELLIA_DECRYPT 0 * \addtogroup mbedtls
* \{
* \defgroup mbedtls_camellia_module Camellia
* \{
*/
#define MBEDTLS_CAMELLIA_ENCRYPT 1 ///< Constant to select camellia encryption
#define MBEDTLS_CAMELLIA_DECRYPT 0 ///< Constant to select camellia decryption
#if !defined(MBEDTLS_DEPRECATED_REMOVED) #if !defined(MBEDTLS_DEPRECATED_REMOVED)
#define MBEDTLS_ERR_CAMELLIA_INVALID_KEY_LENGTH MBEDTLS_DEPRECATED_NUMERIC_CONSTANT( -0x0024 ) #define MBEDTLS_ERR_CAMELLIA_INVALID_KEY_LENGTH MBEDTLS_DEPRECATED_NUMERIC_CONSTANT( -0x0024 )
@ -306,6 +313,9 @@ int mbedtls_camellia_crypt_ctr( mbedtls_camellia_context *ctx,
unsigned char *output ); unsigned char *output );
#endif /* MBEDTLS_CIPHER_MODE_CTR */ #endif /* MBEDTLS_CIPHER_MODE_CTR */
/// \}
/// \}
#if defined(MBEDTLS_SELF_TEST) #if defined(MBEDTLS_SELF_TEST)
/** /**

View File

@ -65,6 +65,13 @@
extern "C" { extern "C" {
#endif #endif
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_ccm_module CCM
* \{
*/
#if !defined(MBEDTLS_CCM_ALT) #if !defined(MBEDTLS_CCM_ALT)
// Regular implementation // Regular implementation
// //
@ -305,4 +312,7 @@ int mbedtls_ccm_self_test( int verbose );
} }
#endif #endif
/// \}
/// \}
#endif /* MBEDTLS_CCM_H */ #endif /* MBEDTLS_CCM_H */

View File

@ -41,6 +41,13 @@
#include <stdint.h> #include <stdint.h>
#include <stddef.h> #include <stddef.h>
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_chacha20_module ChaCha20
* \{
*/
#define MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA -0x0051 /**< Invalid input parameter(s). */ #define MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA -0x0051 /**< Invalid input parameter(s). */
/* MBEDTLS_ERR_CHACHA20_FEATURE_UNAVAILABLE is deprecated and should not be /* MBEDTLS_ERR_CHACHA20_FEATURE_UNAVAILABLE is deprecated and should not be
@ -218,6 +225,9 @@ int mbedtls_chacha20_crypt( const unsigned char key[32],
int mbedtls_chacha20_self_test( int verbose ); int mbedtls_chacha20_self_test( int verbose );
#endif /* MBEDTLS_SELF_TEST */ #endif /* MBEDTLS_SELF_TEST */
/// \}
/// \}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -48,6 +48,11 @@
extern "C" { extern "C" {
#endif #endif
/**
* \addtogroup mbedtls_chacha20_module
* \{
*/
typedef enum typedef enum
{ {
MBEDTLS_CHACHAPOLY_ENCRYPT, /**< The mode value for performing encryption. */ MBEDTLS_CHACHAPOLY_ENCRYPT, /**< The mode value for performing encryption. */
@ -350,6 +355,8 @@ int mbedtls_chachapoly_auth_decrypt( mbedtls_chachapoly_context *ctx,
int mbedtls_chachapoly_self_test( int verbose ); int mbedtls_chachapoly_self_test( int verbose );
#endif /* MBEDTLS_SELF_TEST */ #endif /* MBEDTLS_SELF_TEST */
/// \}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -72,6 +72,13 @@
extern "C" { extern "C" {
#endif #endif
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_cipher_module Cipher
* \{
*/
/** /**
* \brief Supported cipher types. * \brief Supported cipher types.
* *
@ -211,8 +218,8 @@ typedef enum {
/** Type of operation. */ /** Type of operation. */
typedef enum { typedef enum {
MBEDTLS_OPERATION_NONE = -1, MBEDTLS_OPERATION_NONE = -1,
MBEDTLS_DECRYPT = 0, MBEDTLS_DECRYPT = 0, ///< Operation type for decryption
MBEDTLS_ENCRYPT, MBEDTLS_ENCRYPT, ///< Operation type for encryption
} mbedtls_operation_t; } mbedtls_operation_t;
enum { enum {
@ -1087,6 +1094,10 @@ int mbedtls_cipher_auth_decrypt_ext( mbedtls_cipher_context_t *ctx,
unsigned char *output, size_t output_len, unsigned char *output, size_t output_len,
size_t *olen, size_t tag_len ); size_t *olen, size_t tag_len );
#endif /* MBEDTLS_CIPHER_MODE_AEAD || MBEDTLS_NIST_KW_C */ #endif /* MBEDTLS_CIPHER_MODE_AEAD || MBEDTLS_NIST_KW_C */
/// \}
/// \}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -38,6 +38,13 @@
extern "C" { extern "C" {
#endif #endif
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_cmac_module CMAC
* \{
*/
/* MBEDTLS_ERR_CMAC_HW_ACCEL_FAILED is deprecated and should not be used. */ /* MBEDTLS_ERR_CMAC_HW_ACCEL_FAILED is deprecated and should not be used. */
#define MBEDTLS_ERR_CMAC_HW_ACCEL_FAILED -0x007A /**< CMAC hardware accelerator failed. */ #define MBEDTLS_ERR_CMAC_HW_ACCEL_FAILED -0x007A /**< CMAC hardware accelerator failed. */
@ -204,6 +211,9 @@ int mbedtls_aes_cmac_prf_128( const unsigned char *key, size_t key_len,
int mbedtls_cmac_self_test( int verbose ); int mbedtls_cmac_self_test( int verbose );
#endif /* MBEDTLS_SELF_TEST && ( MBEDTLS_AES_C || MBEDTLS_DES_C ) */ #endif /* MBEDTLS_SELF_TEST && ( MBEDTLS_AES_C || MBEDTLS_DES_C ) */
/// \}
/// \}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -53,6 +53,13 @@
#include "mbedtls/threading.h" #include "mbedtls/threading.h"
#endif #endif
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_ctr_drbg_module CTR_DRBG
* \{
*/
#define MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED -0x0034 /**< The entropy source failed. */ #define MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED -0x0034 /**< The entropy source failed. */
#define MBEDTLS_ERR_CTR_DRBG_REQUEST_TOO_BIG -0x0036 /**< The requested random buffer length is too big. */ #define MBEDTLS_ERR_CTR_DRBG_REQUEST_TOO_BIG -0x0036 /**< The requested random buffer length is too big. */
#define MBEDTLS_ERR_CTR_DRBG_INPUT_TOO_BIG -0x0038 /**< The input (entropy + additional data) is too large. */ #define MBEDTLS_ERR_CTR_DRBG_INPUT_TOO_BIG -0x0038 /**< The input (entropy + additional data) is too large. */
@ -134,7 +141,7 @@
/**< The maximum size of seed or reseed buffer in bytes. */ /**< The maximum size of seed or reseed buffer in bytes. */
#endif #endif
/* \} name SECTION: Module settings */ /** \} name SECTION: Module settings */
#define MBEDTLS_CTR_DRBG_PR_OFF 0 #define MBEDTLS_CTR_DRBG_PR_OFF 0
/**< Prediction resistance is disabled. */ /**< Prediction resistance is disabled. */
@ -559,6 +566,9 @@ int mbedtls_ctr_drbg_self_test( int verbose );
#endif /* MBEDTLS_SELF_TEST */ #endif /* MBEDTLS_SELF_TEST */
/// \}
/// \}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -34,6 +34,14 @@
#include "mbedtls/ecp.h" #include "mbedtls/ecp.h"
#endif #endif
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_debug_module Debug
* \{
*/
#if defined(MBEDTLS_DEBUG_C) #if defined(MBEDTLS_DEBUG_C)
#define MBEDTLS_DEBUG_STRIP_PARENS( ... ) __VA_ARGS__ #define MBEDTLS_DEBUG_STRIP_PARENS( ... ) __VA_ARGS__
@ -255,6 +263,9 @@ void mbedtls_debug_printf_ecdh( const mbedtls_ssl_context *ssl, int level,
mbedtls_debug_ecdh_attr attr ); mbedtls_debug_ecdh_attr attr );
#endif #endif
/// \}
/// \}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -36,6 +36,13 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_des_module DES
* \{
*/
#define MBEDTLS_DES_ENCRYPT 1 #define MBEDTLS_DES_ENCRYPT 1
#define MBEDTLS_DES_DECRYPT 0 #define MBEDTLS_DES_DECRYPT 0
@ -347,6 +354,9 @@ int mbedtls_des_self_test( int verbose );
#endif /* MBEDTLS_SELF_TEST */ #endif /* MBEDTLS_SELF_TEST */
/// \}
/// \}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -70,6 +70,14 @@
#endif #endif
#include "mbedtls/bignum.h" #include "mbedtls/bignum.h"
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_dhm_module Diffie-Hellman-Merkle
* \{
*/
/* /*
* DHM Error codes * DHM Error codes
*/ */
@ -1089,4 +1097,7 @@ int mbedtls_dhm_self_test( int verbose );
#define MBEDTLS_DHM_RFC7919_FFDHE8192_G_BIN { 0x02 } #define MBEDTLS_DHM_RFC7919_FFDHE8192_G_BIN { 0x02 }
/// \}
/// \}
#endif /* dhm.h */ #endif /* dhm.h */

View File

@ -49,6 +49,14 @@
extern "C" { extern "C" {
#endif #endif
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_ecdh_module Elliptic Curve Diffie-Hellman
* \{
*/
/** /**
* Defines the source of the imported EC key. * Defines the source of the imported EC key.
*/ */
@ -439,6 +447,9 @@ int mbedtls_ecdh_calc_secret( mbedtls_ecdh_context *ctx, size_t *olen,
void mbedtls_ecdh_enable_restart( mbedtls_ecdh_context *ctx ); void mbedtls_ecdh_enable_restart( mbedtls_ecdh_context *ctx );
#endif /* MBEDTLS_ECP_RESTARTABLE */ #endif /* MBEDTLS_ECP_RESTARTABLE */
/// \}
/// \}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -39,6 +39,13 @@
#include "mbedtls/ecp.h" #include "mbedtls/ecp.h"
#include "mbedtls/md.h" #include "mbedtls/md.h"
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_ecdsa_module ECDSA
* \{
*/
/** /**
* \brief Maximum ECDSA signature size for a given curve bit size * \brief Maximum ECDSA signature size for a given curve bit size
* *
@ -329,7 +336,7 @@ int mbedtls_ecdsa_verify( mbedtls_ecp_group *grp,
* multiple threads. * multiple threads.
* *
* \note The deterministic version is used if * \note The deterministic version is used if
* #MBEDTLS_ECDSA_DETERMINISTIC is defined. For more * MBEDTLS_ECDSA_DETERMINISTIC is defined. For more
* information, see <em>RFC-6979: Deterministic Usage * information, see <em>RFC-6979: Deterministic Usage
* of the Digital Signature Algorithm (DSA) and Elliptic * of the Digital Signature Algorithm (DSA) and Elliptic
* Curve Digital Signature Algorithm (ECDSA)</em>. * Curve Digital Signature Algorithm (ECDSA)</em>.
@ -357,7 +364,7 @@ int mbedtls_ecdsa_verify( mbedtls_ecp_group *grp,
* \param slen The address at which to store the actual length of * \param slen The address at which to store the actual length of
* the signature written. Must not be \c NULL. * the signature written. Must not be \c NULL.
* \param f_rng The RNG function. This must not be \c NULL if * \param f_rng The RNG function. This must not be \c NULL if
* #MBEDTLS_ECDSA_DETERMINISTIC is unset. Otherwise, * MBEDTLS_ECDSA_DETERMINISTIC is unset. Otherwise,
* it is used only for blinding and may be set to \c NULL, but * it is used only for blinding and may be set to \c NULL, but
* doing so is DEPRECATED. * doing so is DEPRECATED.
* \param p_rng The RNG context to be passed to \p f_rng. This may be * \param p_rng The RNG context to be passed to \p f_rng. This may be
@ -399,7 +406,7 @@ int mbedtls_ecdsa_write_signature( mbedtls_ecdsa_context *ctx,
* \param slen The address at which to store the actual length of * \param slen The address at which to store the actual length of
* the signature written. Must not be \c NULL. * the signature written. Must not be \c NULL.
* \param f_rng The RNG function. This must not be \c NULL if * \param f_rng The RNG function. This must not be \c NULL if
* #MBEDTLS_ECDSA_DETERMINISTIC is unset. Otherwise, * MBEDTLS_ECDSA_DETERMINISTIC is unset. Otherwise,
* it is unused and may be set to \c NULL. * it is unused and may be set to \c NULL.
* \param p_rng The RNG context to be passed to \p f_rng. This may be * \param p_rng The RNG context to be passed to \p f_rng. This may be
* \c NULL if \p f_rng is \c NULL or doesn't use a context. * \c NULL if \p f_rng is \c NULL or doesn't use a context.
@ -619,6 +626,9 @@ void mbedtls_ecdsa_restart_init( mbedtls_ecdsa_restart_ctx *ctx );
void mbedtls_ecdsa_restart_free( mbedtls_ecdsa_restart_ctx *ctx ); void mbedtls_ecdsa_restart_free( mbedtls_ecdsa_restart_ctx *ctx );
#endif /* MBEDTLS_ECP_RESTARTABLE */ #endif /* MBEDTLS_ECP_RESTARTABLE */
/// \}
/// \}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -51,6 +51,13 @@
extern "C" { extern "C" {
#endif #endif
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_ecjpake_module Elliptic Curve J-PAKE
* \{
*/
/** /**
* Roles in the EC J-PAKE exchange * Roles in the EC J-PAKE exchange
*/ */
@ -267,6 +274,9 @@ int mbedtls_ecjpake_self_test( int verbose );
#endif /* MBEDTLS_SELF_TEST */ #endif /* MBEDTLS_SELF_TEST */
/// \}
/// \}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -42,6 +42,13 @@
#include "mbedtls/bignum.h" #include "mbedtls/bignum.h"
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_ecp_module Elliptic Curves over GF(P)
* \{
*/
/* /*
* ECP error codes * ECP error codes
*/ */
@ -293,7 +300,7 @@ mbedtls_ecp_group;
#define MBEDTLS_ECP_FIXED_POINT_OPTIM 1 /**< Enable fixed-point speed-up. */ #define MBEDTLS_ECP_FIXED_POINT_OPTIM 1 /**< Enable fixed-point speed-up. */
#endif /* MBEDTLS_ECP_FIXED_POINT_OPTIM */ #endif /* MBEDTLS_ECP_FIXED_POINT_OPTIM */
/* \} name SECTION: Module settings */ /** \} name SECTION: Module settings */
#else /* MBEDTLS_ECP_ALT */ #else /* MBEDTLS_ECP_ALT */
#include "ecp_alt.h" #include "ecp_alt.h"
@ -878,7 +885,7 @@ int mbedtls_ecp_tls_write_group( const mbedtls_ecp_group *grp,
* intermediate results to prevent potential timing attacks * intermediate results to prevent potential timing attacks
* targeting these results. We recommend always providing * targeting these results. We recommend always providing
* a non-NULL \p f_rng. The overhead is negligible. * a non-NULL \p f_rng. The overhead is negligible.
* Note: unless #MBEDTLS_ECP_NO_INTERNAL_RNG is defined, when * Note: unless MBEDTLS_ECP_NO_INTERNAL_RNG is defined, when
* \p f_rng is NULL, an internal RNG (seeded from the value * \p f_rng is NULL, an internal RNG (seeded from the value
* of \p m) will be used instead. * of \p m) will be used instead.
* *
@ -1247,6 +1254,9 @@ int mbedtls_ecp_self_test( int verbose );
#endif /* MBEDTLS_SELF_TEST */ #endif /* MBEDTLS_SELF_TEST */
/// \}
/// \}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -48,6 +48,13 @@
#include "mbedtls/havege.h" #include "mbedtls/havege.h"
#endif #endif
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_entropy_module Entropy Accumulator
* \{
*/
#define MBEDTLS_ERR_ENTROPY_SOURCE_FAILED -0x003C /**< Critical entropy source failure. */ #define MBEDTLS_ERR_ENTROPY_SOURCE_FAILED -0x003C /**< Critical entropy source failure. */
#define MBEDTLS_ERR_ENTROPY_MAX_SOURCES -0x003E /**< No more sources can be added. */ #define MBEDTLS_ERR_ENTROPY_MAX_SOURCES -0x003E /**< No more sources can be added. */
#define MBEDTLS_ERR_ENTROPY_NO_SOURCES_DEFINED -0x0040 /**< No sources have been added to poll. */ #define MBEDTLS_ERR_ENTROPY_NO_SOURCES_DEFINED -0x0040 /**< No sources have been added to poll. */
@ -70,7 +77,7 @@
#define MBEDTLS_ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */ #define MBEDTLS_ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */
#endif #endif
/* \} name SECTION: Module settings */ /** \} name SECTION: Module settings */
#if defined(MBEDTLS_ENTROPY_SHA512_ACCUMULATOR) #if defined(MBEDTLS_ENTROPY_SHA512_ACCUMULATOR)
#define MBEDTLS_ENTROPY_BLOCK_SIZE 64 /**< Block size of entropy accumulator (SHA-512) */ #define MBEDTLS_ENTROPY_BLOCK_SIZE 64 /**< Block size of entropy accumulator (SHA-512) */
@ -280,6 +287,9 @@ int mbedtls_entropy_source_self_test( int verbose );
#endif /* MBEDTLS_ENTROPY_HARDWARE_ALT */ #endif /* MBEDTLS_ENTROPY_HARDWARE_ALT */
#endif /* MBEDTLS_SELF_TEST */ #endif /* MBEDTLS_SELF_TEST */
/// \}
/// \}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -34,6 +34,11 @@
extern "C" { extern "C" {
#endif #endif
/**
* \addtogroup mbedtls_entropy_module
* \{
*/
/* /*
* Default thresholds for built-in sources, in bytes * Default thresholds for built-in sources, in bytes
*/ */
@ -101,6 +106,8 @@ int mbedtls_nv_seed_poll( void *data,
unsigned char *output, size_t len, size_t *olen ); unsigned char *output, size_t len, size_t *olen );
#endif #endif
/// \}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -31,6 +31,9 @@
#include <stddef.h> #include <stddef.h>
/** /**
* \defgroup mbedtls_errors Error Codes
* \ingroup mbedtls
*
* Error code layout. * Error code layout.
* *
* Currently we try to keep all error codes within the negative space of 16 * Currently we try to keep all error codes within the negative space of 16
@ -42,14 +45,16 @@
* *
* 16 bit error code bit-segmentation * 16 bit error code bit-segmentation
* *
* 1 bit - Unused (sign bit) *
* 3 bits - High level module ID * \li 1 bit - Unused (sign bit)
* 5 bits - Module-dependent error code * \li 3 bits - High level module ID
* 7 bits - Low level module errors * \li 5 bits - Module-dependent error code
* \li 7 bits - Low level module errors
* *
* For historical reasons, low-level error codes are divided in even and odd, * For historical reasons, low-level error codes are divided in even and odd,
* even codes were assigned first, and -1 is reserved for other errors. * even codes were assigned first, and -1 is reserved for other errors.
* *
* \code{.unparsed}
* Low-level module errors (0x0002-0x007E, 0x0001-0x007F) * Low-level module errors (0x0002-0x007E, 0x0001-0x007F)
* *
* Module Nr Codes assigned * Module Nr Codes assigned
@ -105,12 +110,18 @@
* SSL 7 32 * SSL 7 32
* *
* Module dependent error code (5 bits 0x.00.-0x.F8.) * Module dependent error code (5 bits 0x.00.-0x.F8.)
* \endcode
*/ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/**
* \addtogroup mbedtls_errors
* \{
*/
#define MBEDTLS_ERR_ERROR_GENERIC_ERROR -0x0001 /**< Generic error */ #define MBEDTLS_ERR_ERROR_GENERIC_ERROR -0x0001 /**< Generic error */
#define MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED -0x006E /**< This is a bug in the library */ #define MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED -0x006E /**< This is a bug in the library */
@ -155,6 +166,8 @@ const char * mbedtls_high_level_strerr( int error_code );
*/ */
const char * mbedtls_low_level_strerr( int error_code ); const char * mbedtls_low_level_strerr( int error_code );
/// \}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -41,8 +41,15 @@
#include <stdint.h> #include <stdint.h>
#define MBEDTLS_GCM_ENCRYPT 1 /**
#define MBEDTLS_GCM_DECRYPT 0 * \addtogroup mbedtls
* \{
* \defgroup mbedtls_gcm_module Galois/Counter Mode
* \{
*/
#define MBEDTLS_GCM_ENCRYPT 1 ///< Encrypt operation
#define MBEDTLS_GCM_DECRYPT 0 ///< Decrypt operation
#define MBEDTLS_ERR_GCM_AUTH_FAILED -0x0012 /**< Authenticated decryption failed. */ #define MBEDTLS_ERR_GCM_AUTH_FAILED -0x0012 /**< Authenticated decryption failed. */
@ -316,6 +323,9 @@ int mbedtls_gcm_self_test( int verbose );
#endif /* MBEDTLS_SELF_TEST */ #endif /* MBEDTLS_SELF_TEST */
/// \}
/// \}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -37,6 +37,13 @@
extern "C" { extern "C" {
#endif #endif
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_havege_module HAVEGE
* \{
*/
/** /**
* \brief HAVEGE state structure * \brief HAVEGE state structure
*/ */
@ -73,6 +80,9 @@ void mbedtls_havege_free( mbedtls_havege_state *hs );
*/ */
int mbedtls_havege_random( void *p_rng, unsigned char *output, size_t len ); int mbedtls_havege_random( void *p_rng, unsigned char *output, size_t len );
/// \}
/// \}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -33,12 +33,19 @@
#include "mbedtls/md.h" #include "mbedtls/md.h"
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_hkdf_module HKDF
* \{
*/
/** /**
* \name HKDF Error codes * \name HKDF Error codes
* \{ * \{
*/ */
#define MBEDTLS_ERR_HKDF_BAD_INPUT_DATA -0x5F80 /**< Bad input parameters to function. */ #define MBEDTLS_ERR_HKDF_BAD_INPUT_DATA -0x5F80 /**< Bad input parameters to function. */
/* \} name */ /** \} name */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -136,4 +143,7 @@ int mbedtls_hkdf_expand( const mbedtls_md_info_t *md, const unsigned char *prk,
} }
#endif #endif
/// \}
/// \}
#endif /* hkdf.h */ #endif /* hkdf.h */

View File

@ -38,6 +38,13 @@
#include "mbedtls/threading.h" #include "mbedtls/threading.h"
#endif #endif
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_hrmac_drbg_module HMAC_DRBG
* \{
*/
/* /*
* Error codes * Error codes
*/ */
@ -70,7 +77,7 @@
#define MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */ #define MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */
#endif #endif
/* \} name SECTION: Module settings */ /** \} name SECTION: Module settings */
#define MBEDTLS_HMAC_DRBG_PR_OFF 0 /**< No prediction resistance */ #define MBEDTLS_HMAC_DRBG_PR_OFF 0 /**< No prediction resistance */
#define MBEDTLS_HMAC_DRBG_PR_ON 1 /**< Prediction resistance enabled */ #define MBEDTLS_HMAC_DRBG_PR_ON 1 /**< Prediction resistance enabled */
@ -411,6 +418,9 @@ int mbedtls_hmac_drbg_update_seed_file( mbedtls_hmac_drbg_context *ctx, const ch
int mbedtls_hmac_drbg_self_test( int verbose ); int mbedtls_hmac_drbg_self_test( int verbose );
#endif #endif
/// \}
/// \}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -33,6 +33,14 @@
#include MBEDTLS_CONFIG_FILE #include MBEDTLS_CONFIG_FILE
#endif #endif
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_md_module Message Digest (MD)
* \{
*/
#define MBEDTLS_ERR_MD_FEATURE_UNAVAILABLE -0x5080 /**< The selected feature is not available. */ #define MBEDTLS_ERR_MD_FEATURE_UNAVAILABLE -0x5080 /**< The selected feature is not available. */
#define MBEDTLS_ERR_MD_BAD_INPUT_DATA -0x5100 /**< Bad input parameters to function. */ #define MBEDTLS_ERR_MD_BAD_INPUT_DATA -0x5100 /**< Bad input parameters to function. */
#define MBEDTLS_ERR_MD_ALLOC_FAILED -0x5180 /**< Failed to allocate memory. */ #define MBEDTLS_ERR_MD_ALLOC_FAILED -0x5180 /**< Failed to allocate memory. */
@ -467,6 +475,9 @@ int mbedtls_md_hmac( const mbedtls_md_info_t *md_info, const unsigned char *key,
/* Internal use */ /* Internal use */
int mbedtls_md_process( mbedtls_md_context_t *ctx, const unsigned char *data ); int mbedtls_md_process( mbedtls_md_context_t *ctx, const unsigned char *data );
/// \}
/// \}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -35,6 +35,11 @@
#include <stddef.h> #include <stddef.h>
/**
* \ingroup mbedtls_md_module
* \{
*/
/* MBEDTLS_ERR_MD2_HW_ACCEL_FAILED is deprecated and should not be used. */ /* MBEDTLS_ERR_MD2_HW_ACCEL_FAILED is deprecated and should not be used. */
#define MBEDTLS_ERR_MD2_HW_ACCEL_FAILED -0x002B /**< MD2 hardware accelerator failed */ #define MBEDTLS_ERR_MD2_HW_ACCEL_FAILED -0x002B /**< MD2 hardware accelerator failed */
@ -301,4 +306,6 @@ int mbedtls_md2_self_test( int verbose );
} }
#endif #endif
/// \}
#endif /* mbedtls_md2.h */ #endif /* mbedtls_md2.h */

View File

@ -36,6 +36,11 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
/**
* \ingroup mbedtls_md_module
* \{
*/
/* MBEDTLS_ERR_MD4_HW_ACCEL_FAILED is deprecated and should not be used. */ /* MBEDTLS_ERR_MD4_HW_ACCEL_FAILED is deprecated and should not be used. */
#define MBEDTLS_ERR_MD4_HW_ACCEL_FAILED -0x002D /**< MD4 hardware accelerator failed */ #define MBEDTLS_ERR_MD4_HW_ACCEL_FAILED -0x002D /**< MD4 hardware accelerator failed */
@ -306,4 +311,6 @@ int mbedtls_md4_self_test( int verbose );
} }
#endif #endif
/// \}
#endif /* mbedtls_md4.h */ #endif /* mbedtls_md4.h */

View File

@ -35,6 +35,11 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
/**
* \ingroup mbedtls_md_module
* \{
*/
/* MBEDTLS_ERR_MD5_HW_ACCEL_FAILED is deprecated and should not be used. */ /* MBEDTLS_ERR_MD5_HW_ACCEL_FAILED is deprecated and should not be used. */
#define MBEDTLS_ERR_MD5_HW_ACCEL_FAILED -0x002F /**< MD5 hardware accelerator failed */ #define MBEDTLS_ERR_MD5_HW_ACCEL_FAILED -0x002F /**< MD5 hardware accelerator failed */
@ -306,4 +311,6 @@ int mbedtls_md5_self_test( int verbose );
} }
#endif #endif
/// \}
#endif /* mbedtls_md5.h */ #endif /* mbedtls_md5.h */

View File

@ -30,6 +30,13 @@
#include <stddef.h> #include <stddef.h>
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_memory_buffer_alloc_module Memory Buffer Alloc
* \{
*/
/** /**
* \name SECTION: Module settings * \name SECTION: Module settings
* *
@ -42,7 +49,7 @@
#define MBEDTLS_MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */ #define MBEDTLS_MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */
#endif #endif
/* \} name SECTION: Module settings */ /** \} name SECTION: Module settings */
#define MBEDTLS_MEMORY_VERIFY_NONE 0 #define MBEDTLS_MEMORY_VERIFY_NONE 0
#define MBEDTLS_MEMORY_VERIFY_ALLOC (1 << 0) #define MBEDTLS_MEMORY_VERIFY_ALLOC (1 << 0)
@ -146,4 +153,7 @@ int mbedtls_memory_buffer_alloc_self_test( int verbose );
} }
#endif #endif
/// \}
/// \}
#endif /* memory_buffer_alloc.h */ #endif /* memory_buffer_alloc.h */

View File

@ -49,6 +49,13 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_net_module Network Sockets Abstraction
* \{
*/
#define MBEDTLS_ERR_NET_SOCKET_FAILED -0x0042 /**< Failed to open a socket. */ #define MBEDTLS_ERR_NET_SOCKET_FAILED -0x0042 /**< Failed to open a socket. */
#define MBEDTLS_ERR_NET_CONNECT_FAILED -0x0044 /**< The connection to the given server / port failed. */ #define MBEDTLS_ERR_NET_CONNECT_FAILED -0x0044 /**< The connection to the given server / port failed. */
#define MBEDTLS_ERR_NET_BIND_FAILED -0x0046 /**< Binding of the socket failed. */ #define MBEDTLS_ERR_NET_BIND_FAILED -0x0046 /**< Binding of the socket failed. */
@ -273,4 +280,7 @@ void mbedtls_net_free( mbedtls_net_context *ctx );
} }
#endif #endif
/// \}
/// \}
#endif /* net_sockets.h */ #endif /* net_sockets.h */

View File

@ -43,6 +43,13 @@
#include "mbedtls/cipher.h" #include "mbedtls/cipher.h"
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_nist_kw_module NIST Key Wrapping
* \{
*/
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -179,4 +186,7 @@ int mbedtls_nist_kw_self_test( int verbose );
} }
#endif #endif
/// \}
/// \}
#endif /* MBEDTLS_NIST_KW_H */ #endif /* MBEDTLS_NIST_KW_H */

View File

@ -41,6 +41,13 @@
#include "mbedtls/md.h" #include "mbedtls/md.h"
#endif #endif
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_oid_module Object Identifier Database
* \{
*/
#define MBEDTLS_ERR_OID_NOT_FOUND -0x002E /**< OID is not found. */ #define MBEDTLS_ERR_OID_NOT_FOUND -0x002E /**< OID is not found. */
#define MBEDTLS_ERR_OID_BUF_TOO_SMALL -0x000B /**< output buffer is too small */ #define MBEDTLS_ERR_OID_BUF_TOO_SMALL -0x000B /**< output buffer is too small */
@ -644,4 +651,7 @@ int mbedtls_oid_get_pkcs12_pbe_alg( const mbedtls_asn1_buf *oid, mbedtls_md_type
} }
#endif #endif
/// \}
/// \}
#endif /* oid.h */ #endif /* oid.h */

View File

@ -30,6 +30,13 @@
#include <stddef.h> #include <stddef.h>
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_pem_module Privacy Enhanced Mail
* \{
*/
/** /**
* \name PEM Error codes * \name PEM Error codes
* These error codes are returned in case of errors reading the * These error codes are returned in case of errors reading the
@ -45,7 +52,7 @@
#define MBEDTLS_ERR_PEM_PASSWORD_MISMATCH -0x1380 /**< Given private key password does not allow for correct decryption. */ #define MBEDTLS_ERR_PEM_PASSWORD_MISMATCH -0x1380 /**< Given private key password does not allow for correct decryption. */
#define MBEDTLS_ERR_PEM_FEATURE_UNAVAILABLE -0x1400 /**< Unavailable feature, e.g. hashing/encryption combination. */ #define MBEDTLS_ERR_PEM_FEATURE_UNAVAILABLE -0x1400 /**< Unavailable feature, e.g. hashing/encryption combination. */
#define MBEDTLS_ERR_PEM_BAD_INPUT_DATA -0x1480 /**< Bad input parameters to function. */ #define MBEDTLS_ERR_PEM_BAD_INPUT_DATA -0x1480 /**< Bad input parameters to function. */
/* \} name */ /** \} name */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -141,4 +148,7 @@ int mbedtls_pem_write_buffer( const char *header, const char *footer,
} }
#endif #endif
/// \}
/// \}
#endif /* pem.h */ #endif /* pem.h */

View File

@ -78,14 +78,14 @@ extern "C" {
* \brief Public key types * \brief Public key types
*/ */
typedef enum { typedef enum {
MBEDTLS_PK_NONE=0, MBEDTLS_PK_NONE=0, ///< None
MBEDTLS_PK_RSA, MBEDTLS_PK_RSA, ///< RSA
MBEDTLS_PK_ECKEY, MBEDTLS_PK_ECKEY, ///< ECKEY
MBEDTLS_PK_ECKEY_DH, MBEDTLS_PK_ECKEY_DH, ///< ECKEY DH
MBEDTLS_PK_ECDSA, MBEDTLS_PK_ECDSA, ///< ECDSA
MBEDTLS_PK_RSA_ALT, MBEDTLS_PK_RSA_ALT, ///< RSA Alt
MBEDTLS_PK_RSASSA_PSS, MBEDTLS_PK_RSASSA_PSS, ///< RSASSA PSS
MBEDTLS_PK_OPAQUE, MBEDTLS_PK_OPAQUE, ///< OPAQUE
} mbedtls_pk_type_t; } mbedtls_pk_type_t;
/** /**
@ -642,7 +642,7 @@ const char * mbedtls_pk_get_name( const mbedtls_pk_context *ctx );
mbedtls_pk_type_t mbedtls_pk_get_type( const mbedtls_pk_context *ctx ); mbedtls_pk_type_t mbedtls_pk_get_type( const mbedtls_pk_context *ctx );
#if defined(MBEDTLS_PK_PARSE_C) #if defined(MBEDTLS_PK_PARSE_C)
/** \ingroup pk_module */ /** \ingroup mbedtls_pk_module */
/** /**
* \brief Parse a private key in PEM or DER format * \brief Parse a private key in PEM or DER format
* *
@ -675,7 +675,7 @@ int mbedtls_pk_parse_key( mbedtls_pk_context *ctx,
const unsigned char *key, size_t keylen, const unsigned char *key, size_t keylen,
const unsigned char *pwd, size_t pwdlen ); const unsigned char *pwd, size_t pwdlen );
/** \ingroup pk_module */ /** \ingroup mbedtls_pk_module */
/** /**
* \brief Parse a public key in PEM or DER format * \brief Parse a public key in PEM or DER format
* *
@ -701,7 +701,7 @@ int mbedtls_pk_parse_public_key( mbedtls_pk_context *ctx,
const unsigned char *key, size_t keylen ); const unsigned char *key, size_t keylen );
#if defined(MBEDTLS_FS_IO) #if defined(MBEDTLS_FS_IO)
/** \ingroup pk_module */ /** \ingroup mbedtls_pk_module */
/** /**
* \brief Load and parse a private key * \brief Load and parse a private key
* *
@ -725,7 +725,7 @@ int mbedtls_pk_parse_public_key( mbedtls_pk_context *ctx,
int mbedtls_pk_parse_keyfile( mbedtls_pk_context *ctx, int mbedtls_pk_parse_keyfile( mbedtls_pk_context *ctx,
const char *path, const char *password ); const char *path, const char *password );
/** \ingroup pk_module */ /** \ingroup mbedtls_pk_module */
/** /**
* \brief Load and parse a public key * \brief Load and parse a public key
* *

View File

@ -34,6 +34,13 @@
#include <stddef.h> #include <stddef.h>
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_pkcs12_module PKCS#12
* \{
*/
#define MBEDTLS_ERR_PKCS12_BAD_INPUT_DATA -0x1F80 /**< Bad input parameters to function. */ #define MBEDTLS_ERR_PKCS12_BAD_INPUT_DATA -0x1F80 /**< Bad input parameters to function. */
#define MBEDTLS_ERR_PKCS12_FEATURE_UNAVAILABLE -0x1F00 /**< Feature not available, e.g. unsupported encryption scheme. */ #define MBEDTLS_ERR_PKCS12_FEATURE_UNAVAILABLE -0x1F00 /**< Feature not available, e.g. unsupported encryption scheme. */
#define MBEDTLS_ERR_PKCS12_PBE_INVALID_FORMAT -0x1E80 /**< PBE ASN.1 data not as expected. */ #define MBEDTLS_ERR_PKCS12_PBE_INVALID_FORMAT -0x1E80 /**< PBE ASN.1 data not as expected. */
@ -125,4 +132,7 @@ int mbedtls_pkcs12_derivation( unsigned char *data, size_t datalen,
} }
#endif #endif
/// \}
/// \}
#endif /* pkcs12.h */ #endif /* pkcs12.h */

View File

@ -36,6 +36,13 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_pkcs5_module PKCS#5
* \{
*/
#define MBEDTLS_ERR_PKCS5_BAD_INPUT_DATA -0x2f80 /**< Bad input parameters to function. */ #define MBEDTLS_ERR_PKCS5_BAD_INPUT_DATA -0x2f80 /**< Bad input parameters to function. */
#define MBEDTLS_ERR_PKCS5_INVALID_FORMAT -0x2f00 /**< Unexpected ASN.1 data. */ #define MBEDTLS_ERR_PKCS5_INVALID_FORMAT -0x2f00 /**< Unexpected ASN.1 data. */
#define MBEDTLS_ERR_PKCS5_FEATURE_UNAVAILABLE -0x2e80 /**< Requested encryption or digest alg not available. */ #define MBEDTLS_ERR_PKCS5_FEATURE_UNAVAILABLE -0x2e80 /**< Requested encryption or digest alg not available. */
@ -104,4 +111,7 @@ int mbedtls_pkcs5_self_test( int verbose );
} }
#endif #endif
/// \}
/// \}
#endif /* pkcs5.h */ #endif /* pkcs5.h */

View File

@ -41,6 +41,13 @@
#include "mbedtls/platform_time.h" #include "mbedtls/platform_time.h"
#endif #endif
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_platform_module Platform Abstraction Layer
* \{
*/
#define MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED -0x0070 /**< Hardware accelerator failed */ #define MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED -0x0070 /**< Hardware accelerator failed */
#define MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED -0x0072 /**< The requested feature is not supported by the platform */ #define MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED -0x0072 /**< The requested feature is not supported by the platform */
@ -125,7 +132,7 @@ extern "C" {
#endif /* MBEDTLS_PLATFORM_NO_STD_FUNCTIONS */ #endif /* MBEDTLS_PLATFORM_NO_STD_FUNCTIONS */
/* \} name SECTION: Module settings */ /** \} name SECTION: Module settings */
/* /*
* The function pointers for calloc and free. * The function pointers for calloc and free.
@ -414,4 +421,7 @@ void mbedtls_platform_teardown( mbedtls_platform_context *ctx );
} }
#endif #endif
/// \}
/// \}
#endif /* platform.h */ #endif /* platform.h */

View File

@ -28,6 +28,11 @@
#include MBEDTLS_CONFIG_FILE #include MBEDTLS_CONFIG_FILE
#endif #endif
/**
* \ingroup mbedtls_platform_module
* \{
*/
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -73,8 +78,12 @@ int mbedtls_platform_set_time( mbedtls_time_t (*time_func)( mbedtls_time_t* time
#endif /* MBEDTLS_PLATFORM_TIME_MACRO */ #endif /* MBEDTLS_PLATFORM_TIME_MACRO */
#endif /* MBEDTLS_PLATFORM_TIME_ALT */ #endif /* MBEDTLS_PLATFORM_TIME_ALT */
/// \}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/// \}
#endif /* platform_time.h */ #endif /* platform_time.h */

View File

@ -29,6 +29,11 @@
#include MBEDTLS_CONFIG_FILE #include MBEDTLS_CONFIG_FILE
#endif #endif
/**
* \ingroup mbedtls_platform_module
* \{
*/
#include <stddef.h> #include <stddef.h>
#if defined(MBEDTLS_HAVE_TIME_DATE) #if defined(MBEDTLS_HAVE_TIME_DATE)
#include "mbedtls/platform_time.h" #include "mbedtls/platform_time.h"
@ -191,4 +196,6 @@ struct tm *mbedtls_platform_gmtime_r( const mbedtls_time_t *tt,
} }
#endif #endif
/// \}
#endif /* MBEDTLS_PLATFORM_UTIL_H */ #endif /* MBEDTLS_PLATFORM_UTIL_H */

View File

@ -41,6 +41,13 @@
#include <stdint.h> #include <stdint.h>
#include <stddef.h> #include <stddef.h>
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_poly1305_module Poly1305
* \{
*/
#define MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA -0x0057 /**< Invalid input parameter(s). */ #define MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA -0x0057 /**< Invalid input parameter(s). */
/* MBEDTLS_ERR_POLY1305_FEATURE_UNAVAILABLE is deprecated and should not be /* MBEDTLS_ERR_POLY1305_FEATURE_UNAVAILABLE is deprecated and should not be
@ -188,4 +195,7 @@ int mbedtls_poly1305_self_test( int verbose );
} }
#endif #endif
/// \}
/// \}
#endif /* MBEDTLS_POLY1305_H */ #endif /* MBEDTLS_POLY1305_H */

View File

@ -31,6 +31,13 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_ripemd160_module RIPE MD-160
* \{
*/
/* MBEDTLS_ERR_RIPEMD160_HW_ACCEL_FAILED is deprecated and should not be used. /* MBEDTLS_ERR_RIPEMD160_HW_ACCEL_FAILED is deprecated and should not be used.
*/ */
#define MBEDTLS_ERR_RIPEMD160_HW_ACCEL_FAILED -0x0031 /**< RIPEMD160 hardware accelerator failed */ #define MBEDTLS_ERR_RIPEMD160_HW_ACCEL_FAILED -0x0031 /**< RIPEMD160 hardware accelerator failed */
@ -232,4 +239,7 @@ int mbedtls_ripemd160_self_test( int verbose );
} }
#endif #endif
/// \}
/// \}
#endif /* mbedtls_ripemd160.h */ #endif /* mbedtls_ripemd160.h */

View File

@ -41,6 +41,13 @@
#include "mbedtls/threading.h" #include "mbedtls/threading.h"
#endif #endif
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_rsa_module RSA
* \{
*/
/* /*
* RSA Error codes * RSA Error codes
*/ */
@ -73,7 +80,7 @@
#define MBEDTLS_RSA_SIGN 1 /**< Identifier for RSA signature operations. */ #define MBEDTLS_RSA_SIGN 1 /**< Identifier for RSA signature operations. */
#define MBEDTLS_RSA_CRYPT 2 /**< Identifier for RSA encryption and decryption operations. */ #define MBEDTLS_RSA_CRYPT 2 /**< Identifier for RSA encryption and decryption operations. */
#define MBEDTLS_RSA_SALT_LEN_ANY -1 #define MBEDTLS_RSA_SALT_LEN_ANY -1 ///< Constant for mbedtls_rsa_rsassa_pss_verify_ext to accept any salt length
/* /*
* The above constants may be used even if the RSA module is compile out, * The above constants may be used even if the RSA module is compile out,
@ -1272,4 +1279,7 @@ int mbedtls_rsa_self_test( int verbose );
} }
#endif #endif
/// \}
/// \}
#endif /* rsa.h */ #endif /* rsa.h */

View File

@ -38,6 +38,13 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_sha1_module SHA-1
* \{
*/
/* MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED is deprecated and should not be used. */ /* MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED is deprecated and should not be used. */
#define MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED -0x0035 /**< SHA-1 hardware accelerator failed */ #define MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED -0x0035 /**< SHA-1 hardware accelerator failed */
#define MBEDTLS_ERR_SHA1_BAD_INPUT_DATA -0x0073 /**< SHA-1 input data was malformed. */ #define MBEDTLS_ERR_SHA1_BAD_INPUT_DATA -0x0073 /**< SHA-1 input data was malformed. */
@ -347,4 +354,7 @@ int mbedtls_sha1_self_test( int verbose );
} }
#endif #endif
/// \}
/// \}
#endif /* mbedtls_sha1.h */ #endif /* mbedtls_sha1.h */

View File

@ -34,6 +34,14 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_sha256_module SHA-224 and SHA-256
* \{
*/
/* MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED is deprecated and should not be used. */ /* MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED is deprecated and should not be used. */
#define MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED -0x0037 /**< SHA-256 hardware accelerator failed */ #define MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED -0x0037 /**< SHA-256 hardware accelerator failed */
#define MBEDTLS_ERR_SHA256_BAD_INPUT_DATA -0x0074 /**< SHA-256 input data was malformed. */ #define MBEDTLS_ERR_SHA256_BAD_INPUT_DATA -0x0074 /**< SHA-256 input data was malformed. */
@ -292,4 +300,7 @@ int mbedtls_sha256_self_test( int verbose );
} }
#endif #endif
/// \}
/// \}
#endif /* mbedtls_sha256.h */ #endif /* mbedtls_sha256.h */

View File

@ -33,6 +33,13 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_sha512_module SHA-384 and SHA-512
* \{
*/
/* MBEDTLS_ERR_SHA512_HW_ACCEL_FAILED is deprecated and should not be used. */ /* MBEDTLS_ERR_SHA512_HW_ACCEL_FAILED is deprecated and should not be used. */
#define MBEDTLS_ERR_SHA512_HW_ACCEL_FAILED -0x0039 /**< SHA-512 hardware accelerator failed */ #define MBEDTLS_ERR_SHA512_HW_ACCEL_FAILED -0x0039 /**< SHA-512 hardware accelerator failed */
#define MBEDTLS_ERR_SHA512_BAD_INPUT_DATA -0x0075 /**< SHA-512 input data was malformed. */ #define MBEDTLS_ERR_SHA512_BAD_INPUT_DATA -0x0075 /**< SHA-512 input data was malformed. */
@ -311,4 +318,7 @@ int mbedtls_sha512_self_test( int verbose );
} }
#endif #endif
/// \}
/// \}
#endif /* mbedtls_sha512.h */ #endif /* mbedtls_sha512.h */

View File

@ -28,6 +28,13 @@
#include MBEDTLS_CONFIG_FILE #include MBEDTLS_CONFIG_FILE
#endif #endif
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_ssl_module SSL/TLS
* \{
*/
#include "mbedtls/bignum.h" #include "mbedtls/bignum.h"
#include "mbedtls/ecp.h" #include "mbedtls/ecp.h"
@ -291,7 +298,7 @@
#define MBEDTLS_SSL_TLS1_3_PADDING_GRANULARITY 1 #define MBEDTLS_SSL_TLS1_3_PADDING_GRANULARITY 1
#endif #endif
/* \} name SECTION: Module settings */ /** \} name SECTION: Module settings */
/* /*
* Length of the verify data for secure renegotiation * Length of the verify data for secure renegotiation
@ -4349,4 +4356,7 @@ int mbedtls_ssl_tls_prf( const mbedtls_tls_prf_types prf,
} }
#endif #endif
/// \}
/// \}
#endif /* ssl.h */ #endif /* ssl.h */

View File

@ -34,6 +34,11 @@
#include "mbedtls/threading.h" #include "mbedtls/threading.h"
#endif #endif
/**
* \ingroup mbedtls_ssl_module
* \{
*/
/** /**
* \name SECTION: Module settings * \name SECTION: Module settings
* *
@ -50,7 +55,7 @@
#define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /*!< Maximum entries in cache */ #define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /*!< Maximum entries in cache */
#endif #endif
/* \} name SECTION: Module settings */ /** \} name SECTION: Module settings */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -146,4 +151,6 @@ void mbedtls_ssl_cache_free( mbedtls_ssl_cache_context *cache );
} }
#endif #endif
/// \}
#endif /* ssl_cache.h */ #endif /* ssl_cache.h */

View File

@ -32,6 +32,11 @@
#include "mbedtls/cipher.h" #include "mbedtls/cipher.h"
#include "mbedtls/md.h" #include "mbedtls/md.h"
/**
* \ingroup mbedtls_ssl_module
* \{
*/
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -553,4 +558,6 @@ static inline int mbedtls_ssl_ciphersuite_uses_server_signature( const mbedtls_s
} }
#endif #endif
/// \}
#endif /* ssl_ciphersuites.h */ #endif /* ssl_ciphersuites.h */

View File

@ -34,6 +34,11 @@
#include "mbedtls/threading.h" #include "mbedtls/threading.h"
#endif #endif
/**
* \ingroup mbedtls_ssl_module
* \{
*/
/** /**
* \name SECTION: Module settings * \name SECTION: Module settings
* *
@ -45,7 +50,7 @@
#define MBEDTLS_SSL_COOKIE_TIMEOUT 60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */ #define MBEDTLS_SSL_COOKIE_TIMEOUT 60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */
#endif #endif
/* \} name SECTION: Module settings */ /** \} name SECTION: Module settings */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -110,4 +115,6 @@ mbedtls_ssl_cookie_check_t mbedtls_ssl_cookie_check;
} }
#endif #endif
/// \}
#endif /* ssl_cookie.h */ #endif /* ssl_cookie.h */

View File

@ -41,6 +41,11 @@
#include "mbedtls/threading.h" #include "mbedtls/threading.h"
#endif #endif
/**
* \ingroup mbedtls_ssl_module
* \{
*/
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -137,4 +142,6 @@ void mbedtls_ssl_ticket_free( mbedtls_ssl_ticket_context *ctx );
} }
#endif #endif
/// \}
#endif /* ssl_ticket.h */ #endif /* ssl_ticket.h */

View File

@ -30,6 +30,13 @@
#include <stdint.h> #include <stdint.h>
/**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_timing_module Timing
* \{
*/
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -148,4 +155,7 @@ int mbedtls_timing_self_test( int verbose );
} }
#endif #endif
/// \}
/// \}
#endif /* timing.h */ #endif /* timing.h */

View File

@ -33,12 +33,20 @@
#endif #endif
/** /**
* \addtogroup mbedtls
* \{
* \defgroup mbedtls_version_module Versioning
* \{
*/
/*
* The version number x.y.z is split into three parts. * The version number x.y.z is split into three parts.
* Major, Minor, Patchlevel * Major, Minor, Patchlevel
*/ */
#define MBEDTLS_VERSION_MAJOR 2 #define MBEDTLS_VERSION_MAJOR 2 ///< Major Mbed TLS version
#define MBEDTLS_VERSION_MINOR 25 #define MBEDTLS_VERSION_MINOR 25 ///< Minor Mbed TLS version
#define MBEDTLS_VERSION_PATCH 0 #define MBEDTLS_VERSION_PATCH 0 ///< Patch Mbed TLS version
/** /**
* The single version number has the following structure: * The single version number has the following structure:
@ -46,7 +54,15 @@
* Major version | Minor version | Patch version * Major version | Minor version | Patch version
*/ */
#define MBEDTLS_VERSION_NUMBER 0x02190000 #define MBEDTLS_VERSION_NUMBER 0x02190000
/**
* String constant containing the version number in the form "xx.yy.zz"
*/
#define MBEDTLS_VERSION_STRING "2.25.0" #define MBEDTLS_VERSION_STRING "2.25.0"
/**
* String constant containing the library name and version, in the form "mbed TLS xx.yy.zz"
*/
#define MBEDTLS_VERSION_STRING_FULL "mbed TLS 2.25.0" #define MBEDTLS_VERSION_STRING_FULL "mbed TLS 2.25.0"
#if defined(MBEDTLS_VERSION_C) #if defined(MBEDTLS_VERSION_C)
@ -107,4 +123,7 @@ int mbedtls_version_check_feature( const char *feature );
#endif /* MBEDTLS_VERSION_C */ #endif /* MBEDTLS_VERSION_C */
/// \}
/// \}
#endif /* version.h */ #endif /* version.h */

View File

@ -36,10 +36,14 @@
#endif #endif
/** /**
* \addtogroup x509_module * \addtogroup mbedtls
* \{
* \defgroup mbedtls_x509_module X.509
* Structures for parsing X.509 certificates, CRLs and CSRs
* \{ * \{
*/ */
#if !defined(MBEDTLS_X509_MAX_INTERMEDIATE_CA) #if !defined(MBEDTLS_X509_MAX_INTERMEDIATE_CA)
/** /**
* Maximum number of intermediate CAs in a verification chain. * Maximum number of intermediate CAs in a verification chain.
@ -76,7 +80,7 @@
#define MBEDTLS_ERR_X509_FILE_IO_ERROR -0x2900 /**< Read/write of file failed. */ #define MBEDTLS_ERR_X509_FILE_IO_ERROR -0x2900 /**< Read/write of file failed. */
#define MBEDTLS_ERR_X509_BUFFER_TOO_SMALL -0x2980 /**< Destination buffer is too small. */ #define MBEDTLS_ERR_X509_BUFFER_TOO_SMALL -0x2980 /**< Destination buffer is too small. */
#define MBEDTLS_ERR_X509_FATAL_ERROR -0x3000 /**< A fatal error occurred, eg the chain is too long or the vrfy callback failed. */ #define MBEDTLS_ERR_X509_FATAL_ERROR -0x3000 /**< A fatal error occurred, eg the chain is too long or the vrfy callback failed. */
/* \} name */ /** \} name */
/** /**
* \name X509 Verify codes * \name X509 Verify codes
@ -104,8 +108,7 @@
#define MBEDTLS_X509_BADCRL_BAD_PK 0x040000 /**< The CRL is signed with an unacceptable PK alg (eg RSA vs ECDSA). */ #define MBEDTLS_X509_BADCRL_BAD_PK 0x040000 /**< The CRL is signed with an unacceptable PK alg (eg RSA vs ECDSA). */
#define MBEDTLS_X509_BADCRL_BAD_KEY 0x080000 /**< The CRL is signed with an unacceptable key (eg bad curve, RSA too short). */ #define MBEDTLS_X509_BADCRL_BAD_KEY 0x080000 /**< The CRL is signed with an unacceptable key (eg bad curve, RSA too short). */
/* \} name */ /** \} name */
/* \} addtogroup x509_module */
/* /*
* X.509 v3 Subject Alternative Name types. * X.509 v3 Subject Alternative Name types.
@ -196,10 +199,6 @@
extern "C" { extern "C" {
#endif #endif
/**
* \addtogroup x509_module
* \{ */
/** /**
* \name Structures for parsing X.509 certificates, CRLs and CSRs * \name Structures for parsing X.509 certificates, CRLs and CSRs
* \{ * \{
@ -235,8 +234,6 @@ typedef struct mbedtls_x509_time
mbedtls_x509_time; mbedtls_x509_time;
/** \} name Structures for parsing X.509 certificates, CRLs and CSRs */ /** \} name Structures for parsing X.509 certificates, CRLs and CSRs */
/** \} addtogroup x509_module */
/** /**
* \brief Store the certificate DN in printable form into buf; * \brief Store the certificate DN in printable form into buf;
* no more than size characters will be written. * no more than size characters will be written.
@ -356,4 +353,7 @@ int mbedtls_x509_write_sig( unsigned char **p, unsigned char *start,
} }
#endif #endif
/// \}
/// \}
#endif /* x509.h */ #endif /* x509.h */

Some files were not shown because too many files have changed in this diff Show More