Cryptoauthlib buffer management system. More...
#include <stdint.h>#include <stdlib.h>#include <stdbool.h>#include "atca_config_check.h"#include "atca_status.h"Data Structures | |
| struct | cal_buffer_s |
| #define | CAL_BUF_INIT(s, b) { (size_t)(s), (uint8_t*)(b) } |
| typedef struct cal_buffer_s | cal_buffer |
| ATCA_STATUS | cal_buf_read_byte (cal_buffer *cab, size_t offset, uint8_t *value) |
| ATCA_STATUS | cal_buf_write_byte (cal_buffer *cab, size_t offset, uint8_t value) |
| ATCA_STATUS | cal_buf_read_bytes (cal_buffer *cab, size_t offset, void *dest, size_t length) |
| Read bytes from a cal_buffer or cal_buffer linked list. | |
| ATCA_STATUS | cal_buf_write_bytes (cal_buffer *cab, size_t offset, const void *source, size_t length) |
| Write bytes into a single cal_buffer structure or cal_buffer linked list. | |
| ATCA_STATUS | cal_buf_read_number (cal_buffer *cab, size_t offset, void *dest, size_t num_size, bool buf_big_endian) |
| Read a number from a cal_buffer or cal_buffer linked list This function does not reinterpet the number and signedness is only preserved if the destination is the same size as the representation in the buffer. | |
| ATCA_STATUS | cal_buf_write_number (cal_buffer *cab, size_t offset, const void *source, size_t num_size, bool buf_big_endian) |
| Write a number into a cal_buffer or cal_buffer linked list This function does not reinterpet the number and signedness is only preserved if the destination is the same size as the source. | |
| ATCA_STATUS | cal_buf_copy (cal_buffer *dst, size_t dst_offset, cal_buffer *src, size_t src_offset, size_t length) |
| ATCA_STATUS | cal_buf_set (cal_buffer *dst, size_t dst_offset, uint8_t value, size_t length) |
| ATCA_STATUS | cal_buf_set_used (cal_buffer *buf, size_t used) |
| size_t | cal_buf_get_used (cal_buffer *buf) |
| cal_buffer | cal_buf_init_const_ptr (size_t len, const uint8_t *message) |
| Initialize a cal buffer with constant pointer Returns the initialized cal buffer. | |
Cryptoauthlib buffer management system.
| ATCA_STATUS cal_buf_read_bytes | ( | cal_buffer * | cab, |
| size_t | offset, | ||
| void * | dest, | ||
| size_t | length | ||
| ) |
Read bytes from a cal_buffer or cal_buffer linked list.
| [in] | cab | Pointer to a buffer structure or the head of a buffer structure linked list |
| [in] | offset | Offset to start the read from |
| [in] | dest | Pointer to a destination buffer |
| [in] | length | Length of the read - assumes dest has sufficent memory to accept the bytes being read |
| ATCA_STATUS cal_buf_read_number | ( | cal_buffer * | cab, |
| size_t | offset, | ||
| void * | dest, | ||
| size_t | num_size, | ||
| bool | buf_big_endian | ||
| ) |
Read a number from a cal_buffer or cal_buffer linked list This function does not reinterpet the number and signedness is only preserved if the destination is the same size as the representation in the buffer.
| [in] | cab | Pointer to a buffer structure or the head of a buffer structure linked list |
| [in] | offset | Offset to start the read from |
| [in] | dest | Pointer to a destination number |
| [in] | num_size | Size of the number in bytes |
| [in] | buf_big_endian | Specifies the expected endianness representation within the buffer |
| ATCA_STATUS cal_buf_write_bytes | ( | cal_buffer * | cab, |
| size_t | offset, | ||
| const void * | source, | ||
| size_t | length | ||
| ) |
Write bytes into a single cal_buffer structure or cal_buffer linked list.
| [in] | cab | Pointer to a buffer structure or the head of a buffer structure linked list |
| [in] | offset | Target offset to start the write at |
| [in] | source | Pointer to a source buffer |
| [in] | length | Length of the write - assumes source is sufficently large to support this operation |
| ATCA_STATUS cal_buf_write_number | ( | cal_buffer * | cab, |
| size_t | offset, | ||
| const void * | source, | ||
| size_t | num_size, | ||
| bool | buf_big_endian | ||
| ) |
Write a number into a cal_buffer or cal_buffer linked list This function does not reinterpet the number and signedness is only preserved if the destination is the same size as the source.
| [in] | cab | Pointer to a buffer structure or the head of a buffer structure linked list |
| [in] | offset | Offset to start the write at |
| [in] | source | Pointer to a number to be written |
| [in] | num_size | Size of the number in bytes |
| [in] | buf_big_endian | Specifies the expected endianness representation within the buffer |