-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsha204-core.h
executable file
·51 lines (42 loc) · 1.37 KB
/
sha204-core.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef _SHA204A_CORE_H_
#define _SHA204A_CORE_H_
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
/***************************½á¹¹ÌåÉêÃ÷*************************************/
struct sha204h_temp_key
{
uint8_t value[32];
uint8_t key_id :4;
uint8_t source_flag :1;
uint8_t gen_data :1;
uint8_t check_flag :1;
uint8_t valid :1;
};
struct sha204h_nonce_in_out
{
uint8_t mode;
uint8_t *num_in;
uint8_t *rand_out;
struct sha204h_temp_key *temp_key;
};
struct sha204h_gen_dig_in_out
{
uint8_t zone;
uint16_t key_id;
uint8_t *stored_value;
struct sha204h_temp_key *temp_key;
};
struct sha204h_decrypt_in_out
{
uint8_t *data;
struct sha204h_temp_key *temp_key;
};
struct sha204h_nonce_in_out nonce_param; //!< Parameter for nonce helper function
struct sha204h_gen_dig_in_out gendig_param; //!< Parameter for gendig helper function
struct sha204h_temp_key tempkey; //!< Tempkey parameter for nonce and mac helper function
struct sha204h_decrypt_in_out dec_param; //!< Parameter for decrypt helper function
int sha204_read_cfg(uint8_t *response_order);
int sha204_read_otp(uint8_t *response_order);
int sha204_read_solt(uint8_t *secret_key, uint8_t *challenge, uint8_t solt_id, uint8_t read_id, uint8_t *solt_buf);
int sha204_main_handle(uint8_t *secret_key, uint8_t *challenge, uint8_t solt_id, int mode);
#endif