SEcube
SEcube Open Source Library - Host
Data Structures | Typedefs | Functions | Variables
se3_common.h File Reference

This file contains defines and functions common for L0 and L1. More...

#include "se3c0def.h"
#include "aes256.h"
#include "sha256.h"
#include "pbkdf2.h"

Go to the source code of this file.

Data Structures

struct  se3_payload_cryptoctx_
 

Typedefs

typedef struct se3_payload_cryptoctx_ se3_payload_cryptoctx
 

Functions

uint16_t se3_req_len_data (uint16_t len_data_and_headers)
 Compute length of data in a request in terms of SE3_COMM_BLOCK blocks. More...
 
uint16_t se3_req_len_data_and_headers (uint16_t len_data)
 Compute length of data in a request accounting for headers. More...
 
uint16_t se3_resp_len_data (uint16_t len_data_and_headers)
 Compute length of data in a request in terms of SE3_COMM_BLOCK blocks. More...
 
uint16_t se3_resp_len_data_and_headers (uint16_t len_data)
 Compute length of data in a response accounting for headers. More...
 
uint16_t se3_nblocks (uint16_t len)
 Compute number of SE3_COMM_BLOCK blocks, given length in Bytes. More...
 
void se3_payload_cryptoinit (se3_payload_cryptoctx *ctx, const uint8_t *key)
 
void se3_payload_encrypt (se3_payload_cryptoctx *ctx, uint8_t *auth, uint8_t *iv, uint8_t *data, uint16_t nblocks, uint16_t flags)
 
bool se3_payload_decrypt (se3_payload_cryptoctx *ctx, const uint8_t *auth, const uint8_t *iv, uint8_t *data, uint16_t nblocks, uint16_t flags)
 

Variables

const uint8_t se3_magic [SE3_MAGIC_SIZE]
 

Detailed Description

This file contains defines and functions common for L0 and L1.

Function Documentation

uint16_t se3_nblocks ( uint16_t  len)

Compute number of SE3_COMM_BLOCK blocks, given length in Bytes.

Parameters
[in]lenLength
Returns
Number of Blocks
uint16_t se3_req_len_data ( uint16_t  len_data_and_headers)

Compute length of data in a request in terms of SE3_COMM_BLOCK blocks.

Parameters
[in]len_data_and_headersData length
Returns
Number of SE3_COMM_BLOCK blocks
uint16_t se3_req_len_data_and_headers ( uint16_t  len_data)

Compute length of data in a request accounting for headers.

Parameters
[in]len_dataData length
Returns
Number of Bytes
uint16_t se3_resp_len_data ( uint16_t  len_data_and_headers)

Compute length of data in a request in terms of SE3_COMM_BLOCK blocks.

Parameters
[in]len_data_and_headersData length
Returns
Number of SE3_COMM_BLOCK blocks
uint16_t se3_resp_len_data_and_headers ( uint16_t  len_data)

Compute length of data in a response accounting for headers.

Parameters
[in]len_dataData Length
Returns
Number of Bytes