Security and Crypto#

The Security and Crypto module provides interfaces for implementing cryptographic operations within the Sidewalk SDK. These interfaces ensure secure data transmission and storage by offering functionalities such as encryption, decryption, hashing, and key management, enabling developers to protect sensitive information across different hardware platforms.

Modules#

Type definitions

Functions#

sid_error_t

Initialize sid_pal crypto HAL.

sid_error_t

Deinitialize crypto HAL.

sid_error_t
sid_pal_crypto_rand(uint8_t *rand, size_t size)

Generate random number.

sid_error_t
sid_pal_crypto_hash(sid_pal_hash_params_t *params)

Generate hash.

sid_error_t
sid_pal_crypto_hmac(sid_pal_hmac_params_t *params)

Generate HMAC.

sid_error_t
sid_pal_crypto_aes_crypt(sid_pal_aes_params_t *params)

Encrypt or decrypt using following AES algorithm.

sid_error_t
sid_pal_crypto_aead_crypt(sid_pal_aead_params_t *params)

Encrypt or decrypt using AEAD algorithm.

sid_error_t
sid_pal_crypto_ecc_dsa(sid_pal_dsa_params_t *params)

Sign or verify elliptic curve digital signature using given algorithm.

sid_error_t
sid_pal_crypto_ecc_ecdh(sid_pal_ecdh_params_t *params)

Generate shared secret using private key and public key.

sid_error_t
sid_pal_crypto_ecc_key_gen(sid_pal_ecc_key_gen_params_t *params)

Generate ECC key pair using given algorithm.

Function Documentation#

sid_pal_crypto_init#

sid_error_t sid_pal_crypto_init (void )

Initialize sid_pal crypto HAL.

Parameters
N/A

This function initializes the SID PAL crypto HAL and prepares it for cryptographic operations.


Definition at line 244 of file /home/jenkins/workspace/pal-layer-using-doxygen-comments/component/amazon/projects/sid/sal/common/public/sid_pal_ifc/crypto/sid_pal_crypto_ifc.h

sid_pal_crypto_deinit#

sid_error_t sid_pal_crypto_deinit (void )

Deinitialize crypto HAL.

Parameters
N/A

This function deinitializes the SID PAL crypto HAL and releases any resources that were allocated.


Definition at line 254 of file /home/jenkins/workspace/pal-layer-using-doxygen-comments/component/amazon/projects/sid/sal/common/public/sid_pal_ifc/crypto/sid_pal_crypto_ifc.h

sid_pal_crypto_rand#

sid_error_t sid_pal_crypto_rand (uint8_t * rand, size_t size)

Generate random number.

Parameters
[out]rand

Pointer to rand buffer.

[in]size

Size of rand number

This function generates a random number and stores it in the provided buffer.


Definition at line 267 of file /home/jenkins/workspace/pal-layer-using-doxygen-comments/component/amazon/projects/sid/sal/common/public/sid_pal_ifc/crypto/sid_pal_crypto_ifc.h

sid_pal_crypto_hash#

sid_error_t sid_pal_crypto_hash (sid_pal_hash_params_t * params)

Generate hash.

Parameters
[inout]params

Pointer to the hash parameters.

SHA256 and SHA512 is now supported.

This function generates a hash using the specified parameters.


Definition at line 278 of file /home/jenkins/workspace/pal-layer-using-doxygen-comments/component/amazon/projects/sid/sal/common/public/sid_pal_ifc/crypto/sid_pal_crypto_ifc.h

sid_pal_crypto_hmac#

sid_error_t sid_pal_crypto_hmac (sid_pal_hmac_params_t * params)

Generate HMAC.

Parameters
[inout]params

Pointer to the hash parameters.

HMAC/SHA256 and HMAC/SHA512 is now supported.

This function generates an HMAC using the specified parameters.


Definition at line 289 of file /home/jenkins/workspace/pal-layer-using-doxygen-comments/component/amazon/projects/sid/sal/common/public/sid_pal_ifc/crypto/sid_pal_crypto_ifc.h

sid_pal_crypto_aes_crypt#

sid_error_t sid_pal_crypto_aes_crypt (sid_pal_aes_params_t * params)

Encrypt or decrypt using following AES algorithm.

Parameters
[inout]params

Pointer to AES parameters.

AES-CMAC AES-CTR are supported.

This function encrypts or decrypts data using the specified AES algorithm.


Definition at line 300 of file /home/jenkins/workspace/pal-layer-using-doxygen-comments/component/amazon/projects/sid/sal/common/public/sid_pal_ifc/crypto/sid_pal_crypto_ifc.h

sid_pal_crypto_aead_crypt#

sid_error_t sid_pal_crypto_aead_crypt (sid_pal_aead_params_t * params)

Encrypt or decrypt using AEAD algorithm.

Parameters
[inout]params

Pointer to the AEAD parameters.

This function encrypts or decrypts data using the specified AEAD algorithm.


Definition at line 311 of file /home/jenkins/workspace/pal-layer-using-doxygen-comments/component/amazon/projects/sid/sal/common/public/sid_pal_ifc/crypto/sid_pal_crypto_ifc.h

sid_pal_crypto_ecc_dsa#

sid_error_t sid_pal_crypto_ecc_dsa (sid_pal_dsa_params_t * params)

Sign or verify elliptic curve digital signature using given algorithm.

Parameters
[inout]params

Pointer to the ECC DSA parameters.

This function signs or verifies an elliptic curve digital signature using the specified parameters.


Definition at line 323 of file /home/jenkins/workspace/pal-layer-using-doxygen-comments/component/amazon/projects/sid/sal/common/public/sid_pal_ifc/crypto/sid_pal_crypto_ifc.h

sid_pal_crypto_ecc_ecdh#

sid_error_t sid_pal_crypto_ecc_ecdh (sid_pal_ecdh_params_t * params)

Generate shared secret using private key and public key.

Parameters
[inout]params

Pointer to the ECDH parameters.

This function generates a shared secret using the specified private key and public key.


Definition at line 334 of file /home/jenkins/workspace/pal-layer-using-doxygen-comments/component/amazon/projects/sid/sal/common/public/sid_pal_ifc/crypto/sid_pal_crypto_ifc.h

sid_pal_crypto_ecc_key_gen#

sid_error_t sid_pal_crypto_ecc_key_gen (sid_pal_ecc_key_gen_params_t * params)

Generate ECC key pair using given algorithm.

Parameters
[inout]params

Generate ECC key pair using given algorithm.

This function generates an ECC key pair using the specified algorithm.


Definition at line 345 of file /home/jenkins/workspace/pal-layer-using-doxygen-comments/component/amazon/projects/sid/sal/common/public/sid_pal_ifc/crypto/sid_pal_crypto_ifc.h