Bluetooth Host Stack Library
All Data Structures Functions Variables Typedefs Enumerations Enumerator Modules Pages
wiced_bt_smp_adapter_t Struct Reference

Description

SMP encryption.

Data Fields

wiced_result_t(* pf_smp_process_private_key )(const BT_OCTET32 *private_key, wiced_bt_public_key_t *public_key)
 Callback function to generate local public key. More...
 
wiced_result_t(* pf_smp_compute_dhkey )(const BT_OCTET32 *private_key, const wiced_bt_public_key_t *public_key, BT_OCTET32 *dhkey)
 Callback function to generate dhkey. More...
 
wiced_result_t(* pf_smp_ecdh_validate_pub_key )(const wiced_bt_public_key_t *public_key)
 Callback function to validate peer public key. More...
 
aes_context *(* pf_smp_aes_get_context )()
 Callback function to get a pointer to active aes_context. More...
 
wiced_result_t(* pf_smp_aes_set_key )(const unsigned char key[], uint8_t keylen, aes_context *p_ctx)
 Callback function to set key for encryption. More...
 
wiced_result_t(* pf_smp_aes_encrypt )(const unsigned char in[], unsigned char out[], aes_context *p_ctx)
 Callback function to do the encryption. More...
 
wiced_result_t(* pf_smp_aes_finish )(aes_context *p_ctx, uint8_t *output_external, size_t output_size, size_t *output_length)
 Callback function to finish encryption. More...
 

Field Documentation

◆ pf_smp_process_private_key

wiced_result_t(* wiced_bt_smp_adapter_t::pf_smp_process_private_key) (const BT_OCTET32 *private_key, wiced_bt_public_key_t *public_key)

Callback function to generate local public key.

Called by stack to generate local public key by processing local private key

Parameters
[in]private_key: Pointer to local private key
[out]public_key: Pointer to generated public key
Returns
: wiced_result_t

◆ pf_smp_compute_dhkey

wiced_result_t(* wiced_bt_smp_adapter_t::pf_smp_compute_dhkey) (const BT_OCTET32 *private_key, const wiced_bt_public_key_t *public_key, BT_OCTET32 *dhkey)

Callback function to generate dhkey.

Called by stack to generate diffie-hellman key using peer public key and local private key

Parameters
[in]private_key: Pointer to local private key
[in]public_key: Pointer to peer public key
[in]dhkey: Pointer to generated dhkey
Returns
: wiced_result_t

◆ pf_smp_ecdh_validate_pub_key

wiced_result_t(* wiced_bt_smp_adapter_t::pf_smp_ecdh_validate_pub_key) (const wiced_bt_public_key_t *public_key)

Callback function to validate peer public key.

Called by stack to validate peer public key

Parameters
[in]public_key: Pointer to peer public key
Returns
: wiced_result_t

◆ pf_smp_aes_get_context

aes_context*(* wiced_bt_smp_adapter_t::pf_smp_aes_get_context) ()

Callback function to get a pointer to active aes_context.

Callback function to get a pointer to active aes_context for encryption operation

Returns
: pointer to aes_context

◆ pf_smp_aes_set_key

wiced_result_t(* wiced_bt_smp_adapter_t::pf_smp_aes_set_key) (const unsigned char key[], uint8_t keylen, aes_context *p_ctx)

Callback function to set key for encryption.

Called by stack to provide key details to be used for encryption

Parameters
[in]key: Pointer to key
[in]keylen: length of the key
[in]p_ctx: Pointer to active aes_context
Returns
: wiced_result_t

◆ pf_smp_aes_encrypt

wiced_result_t(* wiced_bt_smp_adapter_t::pf_smp_aes_encrypt) (const unsigned char in[], unsigned char out[], aes_context *p_ctx)

Callback function to do the encryption.

Called by stack to encrypt given data

Parameters
[in]in: Pointer to input data to be encrypted. Input data is always 16 bytes in length.
[out]out: Pointer to encrypted data. Encrypted data is always 16 bytes in length.
[in]p_ctx: Pointer to aes_context
Returns
: wiced_result_t

◆ pf_smp_aes_finish

wiced_result_t(* wiced_bt_smp_adapter_t::pf_smp_aes_finish) (aes_context *p_ctx, uint8_t *output_external, size_t output_size, size_t *output_length)

Callback function to finish encryption.

Called by stack to finish encrypting a message

Parameters
[in]p_ctx: Pointer to aes_context
[in]output_external: Buffer where the output is to be written
[out]output_size: Size of the output_external buffer in bytes.
[out]output_length: On success, the number of bytes that make up the returned output
Returns
: wiced_result_t