13 #define SE3_REQ_CHALLENGE_SIZE (96+16) 14 #define SE3_REQ_CHALLENGE_IV_OFFSET (0) 15 #define SE3_REQ_CHALLENGE_TOKEN_OFFSET (16) 16 #define SE3_REQ_CHALLENGE_CC_OFFSET (32) 17 #define SE3_REQ_CHALLENGE_CC2_OFFSET (64) 18 #define SE3_REQ_CHALLENGE_ACCESS_OFFSET (96) 20 #define SE3_RESP_CHALLENGE_SC_OFFSET (32) 21 #define SE3_RESP_LOGIN_TOKEN_OFFSET (32) 35 uint8_t token[SE3_L1_TOKEN_SIZE];
36 uint8_t key[SE3_L1_KEY_SIZE];
37 uint8_t buf[SE3_COMM_N * SE3_COMM_BLOCK];
43 bool cryptoctx_initialized;
54 uint8_t name[SE3_KEY_NAME_MAX];
59 uint8_t name[SE3_CMD1_CRYPTO_ALGOINFO_NAME_SIZE];
179 uint16_t
L1_crypto_update(
se3_session* s, uint32_t sess_id, uint16_t flags, uint16_t data1_len, uint8_t* data1, uint16_t data2_len, uint8_t* data2, uint16_t* dataout_len, uint8_t* data_out);
207 uint16_t
L1_encrypt(
se3_session* s, uint16_t algorithm, uint16_t mode, uint32_t key_id,
size_t datain_len, int8_t* data_in,
size_t* dataout_len, uint8_t* data_out);
224 uint16_t
L1_decrypt(
se3_session* s, uint16_t algorithm, uint16_t mode, uint32_t key_id,
size_t datain_len, int8_t* data_in,
size_t* dataout_len, uint8_t* data_out);
238 uint16_t
L1_digest(
se3_session* s, uint16_t algorithm,
size_t datain_len, int8_t* data_in,
size_t* dataout_len, uint8_t* data_out);
uint16_t L1_decrypt(se3_session *s, uint16_t algorithm, uint16_t mode, uint32_t key_id, size_t datain_len, int8_t *data_in, size_t *dataout_len, uint8_t *data_out)
This function is used to decrypt a buffer of data given the algorithm, the decryption mode...
Definition: L1.c:539
This file contains defines to be used both for L1 and L0 functions.
struct se3_session_ se3_session
SEcube Communication session structure.
uint16_t L1_logout(se3_session *s)
This function is used to logout from the device.
Definition: L1.c:174
uint16_t L1_key_list(se3_session *s, uint16_t skip, uint16_t max_keys, se3_key *key_array, uint16_t *count)
This function is used get the list of the already of the already available keys on the device...
Definition: L1.c:308
uint16_t L1_set_admin_PIN(se3_session *s, uint8_t *pin)
This function is used to change the current admin pin.
Definition: L1.c:224
struct se3_algo_ se3_algo
SEcube Algorithm structure.
uint16_t L1_login(se3_session *s, se3_device *dev, const uint8_t *pin, uint16_t access)
This function is used to let a user/admin login on the device.
Definition: L1.c:98
uint16_t L1_set_user_PIN(se3_session *s, uint8_t *pin)
This function is used to change the current user pin.
Definition: L1.c:233
uint16_t L1_crypto_set_time(se3_session *s, uint32_t devtime)
Set time for a crypto session.
Definition: L1.c:480
SEcube Communication session structure.
Definition: L1.h:33
This file contains L0 functions and structures.
Definition: se3_common.h:68
uint16_t L1_key_edit(se3_session *s, uint16_t op, se3_key *k)
This function is used to edit the keys data on the device.
Definition: L1.c:242
struct se3_key_ se3_key
SEcube Key structure.
uint16_t L1_crypto_init(se3_session *s, uint16_t algorithm, uint16_t mode, uint32_t key_id, uint32_t *sess_id)
Initialise a crypto session.
Definition: L1.c:338
bool L1_find_key(se3_session *s, uint32_t key_id)
Check if a Key is present or not.
Definition: L1.c:320
uint16_t L1_crypto_update(se3_session *s, uint32_t sess_id, uint16_t flags, uint16_t data1_len, uint8_t *data1, uint16_t data2_len, uint8_t *data2, uint16_t *dataout_len, uint8_t *data_out)
Update a crypto session.
Definition: L1.c:365
SEcube Key structure.
Definition: L1.h:48
SEcube Device structure.
Definition: L0.h:27
uint16_t L1_get_algorithms(se3_session *s, uint16_t skip, uint16_t max_algorithms, se3_algo *algorithms_array, uint16_t *count)
This function is used to retrieve a list from the device of available algorithms. ...
Definition: L1.c:426
uint16_t L1_digest(se3_session *s, uint16_t algorithm, size_t datain_len, int8_t *data_in, size_t *dataout_len, uint8_t *data_out)
This function is used to sign a buffer of data given the algorithm, the amount of data to sign and wh...
Definition: L1.c:544
uint16_t L1_encrypt(se3_session *s, uint16_t algorithm, uint16_t mode, uint32_t key_id, size_t datain_len, int8_t *data_in, size_t *dataout_len, uint8_t *data_out)
This function is used to encrypt a buffer of data given the algorithm, the encryption mode...
Definition: L1.c:493
SEcube Algorithm structure.
Definition: L1.h:58