9 #ifndef __CRYPTO_PROTOCOL_H__ 10 #define __CRYPTO_PROTOCOL_H__ 16 #define BRP_AES_KEY_SIZE 16 17 #define BRP_AES_BLOCK_SIZE 16 55 #define BRP_SECMODE_STD 0 68 #define BRP_SECMODE_PLAIN 1 88 #define BRP_SECMODE_STATELESS 2 95 #define BRP_MAX_SECURITY_LEVEL 3 132 int * req_auth_modes,
unsigned char brp_sec_key[BRP_AES_KEY_SIZE]
A AES128 key, that is required for crypto operations.
BRP_LIB brp_protocol brp_create_secure_channel(int security_level, brp_sec_key key, int sec_mode)
Creates a new secured channel that allows you to establish an authenticated and encrypted connection ...
unsigned int brp_errcode
This type is used library-wide for passing error codes in the return value of functions.
struct brp_protocol_t * brp_protocol
This is a generic handle of a protocol.
unsigned long brp_time
absolute/relative timeout/delay in ms.
This file primarly defines the common part of all protocol's data structures (:brp_protocol_t) and AP...
#define BRP_AES_BLOCK_SIZE
BRP_LIB brp_errcode brp_secured_send_frm(brp_protocol protocol, int security_level, int sec_mode, brp_sec_key key, brp_sec_iv iv, int cmd_code, brp_buf param_buf, size_t param_len, brp_time cmd_timeout, int mode)
Sends an encrypted command.
unsigned char brp_sec_iv[BRP_AES_BLOCK_SIZE]
A AES IV.
BRP_LIB brp_errcode brp_mutual_authenticate(brp_protocol protocol, int security_level, brp_sec_key key, int *req_auth_modes, brp_sec_key session_key)
Does a mutual authentication and generates a session key.
BRP_LIB brp_errcode brp_secured_recv_frm(brp_protocol protocol, int sec_mode, brp_sec_key key, brp_sec_iv iv, int cmd_code, brp_frame resp_frm, brp_time timeout)
Sends an encrypted command.
unsigned char * brp_buf
represents a pointer to a protocol data buffer.