SEcube
SEcube Open Source Library - Device
Data Structures | Typedefs | Enumerations | Functions | Variables
se3c1.h File Reference

L1 structures and functions. More...

#include "se3c0.h"
#include "se3c1def.h"
#include "se3_memory.h"
#include "se3_keys.h"

Go to the source code of this file.

Data Structures

struct  SE3_RECORD_INFO_
 Record information. More...
 
struct  se3_algo_descriptor_
 algorithm descriptor type More...
 
struct  SE3_LOGIN_STATUS_
 L1 login status data. More...
 
struct  SE3_L1_GLOBALS_
 L1 globals structure. More...
 

Typedefs

typedef struct SE3_RECORD_INFO_ SE3_RECORD_INFO
 Record information.
 
typedef uint16_t(* se3_crypto_init_handler) (se3_flash_key *key, uint16_t mode, uint8_t *ctx)
 L1_crypto_init function type.
 
typedef uint16_t(* se3_crypto_update_handler) (uint8_t *ctx, uint16_t flags, uint16_t datain1_len, const uint8_t *datain1, uint16_t datain2_len, const uint8_t *datain2, uint16_t *dataout_len, uint8_t *dataout)
 L1_crypto_update function type.
 
typedef struct se3_algo_descriptor_ se3_algo_descriptor
 algorithm descriptor type
 
typedef struct SE3_LOGIN_STATUS_ SE3_LOGIN_STATUS
 L1 login status data.
 
typedef struct SE3_L1_GLOBALS_ SE3_L1_GLOBALS
 L1 globals structure.
 

Enumerations

enum  { SE3_FLASH_TYPE_RECORD = 0xF0 }
 
enum  { SE3_RECORD_SIZE_TYPE = 2, SE3_RECORD_OFFSET_TYPE = 0, SE3_RECORD_OFFSET_DATA = 2 }
 
enum  { SE3_SESSIONS_BUF = (32*1024), SE3_SESSIONS_MAX = 100 }
 

Functions

bool se3c1_record_set (uint16_t type, const uint8_t *data)
 Write record. More...
 
bool se3c1_record_get (uint16_t type, uint8_t *data)
 Read record. More...
 
void se3c1_login_cleanup ()
 Clear login session data. More...
 
void se3c1_init ()
 Initialize L1 structures.
 

Variables

uint8_t se3_sessions_buf [SE3_SESSIONS_BUF]
 
uint8_t * se3_sessions_index [SE3_SESSIONS_MAX]
 
se3_algo_descriptor L1d_algo_table [SE3_ALGO_MAX]
 
SE3_L1_GLOBALS se3c1
 L1 globals.
 

Detailed Description

L1 structures and functions.

Author
Nicola Ferri

Enumeration Type Documentation

anonymous enum
Enumerator
SE3_FLASH_TYPE_RECORD 

flash node type: record

anonymous enum
Enumerator
SE3_RECORD_SIZE_TYPE 

record.type field size

SE3_RECORD_OFFSET_TYPE 

record.type field offset

SE3_RECORD_OFFSET_DATA 

record.data field offset

anonymous enum
Enumerator
SE3_SESSIONS_BUF 

session buffer size

SE3_SESSIONS_MAX 

maximum number of sessions

Function Documentation

void se3c1_login_cleanup ( )

Clear login session data.

Cleans all data associated with the login session, making SEcube ready for a new login.

bool se3c1_record_get ( uint16_t  type,
uint8_t *  data 
)

Read record.

Get data of a record.

Parameters
typetype of record
dataoutput buffer
Returns
true on success; false if the record does not exist or has never been written
bool se3c1_record_set ( uint16_t  type,
const uint8_t *  data 
)

Write record.

Set data of a record

Remarks
if a flash operation fails, the hwerror flag (se3c0.hwerror) is set.
Parameters
typetype of record
datanew data to be written to record
Returns
true on success; false if the record does not exist

Variable Documentation

se3_algo_descriptor L1d_algo_table[SE3_ALGO_MAX]

algorithm description table

uint8_t se3_sessions_buf[SE3_SESSIONS_BUF]

session buffer

uint8_t* se3_sessions_index[SE3_SESSIONS_MAX]

session index