9#define AES_BLOCK_SIZE 16
17#define PARAMETER_ID_SIZE 2
29#define TIMESTAMP_SIZE 4
35#define SHA256_DIGEST_SIZE 32
41#define ECDSA_SIGNATURE_SIZE 64
47#define METADATA_SIZE (PARAMETER_ID_SIZE + NODE_ID_SIZE + TIMESTAMP_SIZE + \
48 SHA256_DIGEST_SIZE + ECDSA_SIGNATURE_SIZE)
50#define MAX_BLOCK_SIZE (7 * 255)
51#define MAX_PD_SIZE (MAX_BLOCK_SIZE - METADATA_SIZE)
53#define DATA_BLOB_SIZE AES_IV_LEN + DATA_TO_ENCRYPT_SIZE
54#define CAN_DATA_SIZE 147
132 int make(uint32_t data, uint32_t parameter);
143 int make(
void* data,
size_t dataLen, uint32_t parameter);
197 int create_blob(
const uint8_t* plaintext, uint16_t plaintext_len, uint8_t* blob);
Class is an API for creating and sending IoT Blocks.
Definition: iot-block.h:75
void print()
Prints whole Iot Block data.
uint8_t * get_frame_as_array()
Return pointer to uint8_t array of CAN_DATA_SIZE size. The array contains whole IoT block.
IoTBlock_Sizes_t
IoTBlock predefined sizes.
Definition: iot-block.h:109
@ SIZE_S
Definition: iot-block.h:110
@ SIZE_M
Definition: iot-block.h:111
@ SIZE_XL
Definition: iot-block.h:113
@ SIZE_L
Definition: iot-block.h:112
Frame * get_frame()
Return pointer to Frame structure. The structure contains whole IoT block.
int make(void *data, size_t dataLen, uint32_t parameter)
Prepare IoT block consisting of the Initialize Vector, encrypted data, parameter ID,...
uint32_t get_blob_size()
Get the blob size.
int make(uint32_t data, uint32_t parameter)
Prepare IoT block consisting of the Initialize Vector, encrypted data, parameter ID,...
IoTBlock(Transport_layer *comm)
Construct a new IoT Block object.
struct __attribute__((packed)) Frame
Structure contains node's data needed for encryption and final CAN frame.
Definition: iot-block.h:95
int make(void *data, IoTBlock_Sizes_t size, uint32_t parameter)
Prepare IoT block consisting of the Initialize Vector, encrypted data, parameter ID,...
void send()
Send IoT Block by chosen transport layer. Before sending, the Block has to be prepared with the make(...
Virtual class providing interface for communication interfaces.
Definition: transport_layer.h:29
#define NODE_ID_SIZE
Size of node Id field.
Definition: iot-block.h:23
#define MAX_PD_SIZE
Definition: iot-block.h:51
#define SHA256_DIGEST_SIZE
Size of SHA256 digest.
Definition: iot-block.h:35
#define ECDSA_SIGNATURE_SIZE
Size of ECDSA signature.
Definition: iot-block.h:41
The namespace contains all of components of vitro-shard-sdk and components based on the sdk....
Definition: can_layer.h:9