SEcube
SEcube Open Source Library - Device
Functions | Variables
se3c1.c File Reference

L1 structures and functions. More...

#include "se3c1.h"
#include "se3_flash.h"
#include "se3_cmd1.h"
#include "se3_algo_Aes.h"
#include "se3_algo_sha256.h"
#include "se3_algo_HmacSha256.h"
#include "se3_algo_AesHmacSha256s.h"
#include "se3_algo_aes256hmacsha256.h"

Functions

static bool se3c1_record_find (uint16_t record_type, se3_flash_it *it)
 
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_L1_GLOBALS se3c1
 L1 globals.
 
se3_algo_descriptor L1d_algo_table [SE3_ALGO_MAX]
 

Detailed Description

L1 structures and functions.

Author
Nicola Ferri

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