gr55xx_hal_pkc.h
Go to the documentation of this file.
1
51 /* Define to prevent recursive inclusion -------------------------------------*/
52 #ifndef __GR55xx_HAL_PKC_H__
53 #define __GR55xx_HAL_PKC_H__
54
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58
59 /* Includes ------------------------------------------------------------------*/
60 #include "gr55xx_ll_pkc.h"
61 #include "gr55xx_hal_def.h"
62
63 /* Exported types ------------------------------------------------------------*/
75 typedef enum
76 {
77 HAL_PKC_STATE_RESET = 0x00,
78 HAL_PKC_STATE_READY = 0x01,
79 HAL_PKC_STATE_BUSY = 0x02,
80 HAL_PKC_STATE_ERROR = 0x04,
81 HAL_PKC_STATE_TIMEOUT = 0x08,
83 } hal_pkc_state_t;
84
100 typedef struct _ll_ecc_point ecc_point_t;
101
105 typedef struct _ll_ecc_curve_init ecc_curve_init_t;
106
110 typedef struct
111 {
112 ecc_curve_init_t *p_ecc_curve;
114 uint32_t data_bits;
116 uint32_t secure_mode;
120 uint32_t (*random_func)(void);
122 } pkc_init_t;
123
133 typedef struct _pkc_handle
134 {
135 pkc_regs_t *p_instance;
137 pkc_init_t init;
139 void *p_result;
141 uint32_t shift_count;
143 uint32_t *p_P;
145 __IO hal_lock_t lock;
147 __IO hal_pkc_state_t state;
149 __IO uint32_t error_code;
151 uint32_t timeout;
153 uint32_t retention[1];
154 } pkc_handle_t;
165 typedef struct _pkc_ecc_point_multi
166 {
167 uint32_t *p_K;
168 ecc_point_t *p_ecc_point;
169 } pkc_ecc_point_multi_t;
170
175 typedef struct _pkc_rsa_modular_exponent
176 {
177 uint32_t *p_A;
178 uint32_t *p_B;
179 uint32_t *p_P;
180 uint32_t *p_P_R2;
181 uint32_t ConstP;
182 } pkc_rsa_modular_exponent_t;
183
188 typedef struct _pkc_modular_add
189 {
190 uint32_t *p_A;
191 uint32_t *p_B;
192 uint32_t *p_P;
193 } pkc_modular_add_t;
194
199 typedef struct _pkc_modular_sub
200 {
201 uint32_t *p_A;
202 uint32_t *p_B;
203 uint32_t *p_P;
204 } pkc_modular_sub_t;
205
210 typedef struct _pkc_modular_shift
211 {
212 uint32_t *p_A;
213 uint32_t shift_bits;
214 uint32_t *p_P;
215 } pkc_modular_shift_t;
216
221 typedef struct _pkc_modular_compare
222 {
223 uint32_t *p_A;
224 uint32_t *p_P;
225 } pkc_modular_compare_t;
226
231 typedef struct _pkc_montgomery_multi
232 {
233 uint32_t *p_A;
234 uint32_t *p_B;
235 uint32_t *p_P;
236 uint32_t ConstP;
238 } pkc_montgomery_multi_t;
239
244 typedef struct _pkc_montgomery_inversion
245 {
246 uint32_t *p_A;
247 uint32_t *p_P;
248 uint32_t ConstP;
250 } pkc_montgomery_inversion_t;
251
256 typedef struct _pkc_big_number_multi
257 {
258 uint32_t *p_A;
259 uint32_t *p_B;
260 } pkc_big_number_multi_t;
261
266 typedef struct _pkc_big_number_add
267 {
268 uint32_t *p_A;
269 uint32_t *p_B;
270 } pkc_big_number_add_t;
271
288 typedef struct _hal_pkc_callback
289 {
290 void (*pkc_msp_init)(pkc_handle_t *p_pkc);
291 void (*pkc_msp_deinit)(pkc_handle_t *p_pkc);
292 void (*pkc_done_callback)(pkc_handle_t *p_pkc);
293 void (*pkc_error_callback)(pkc_handle_t *p_pkc);
294 void (*pkc_overflow_callback)(pkc_handle_t *p_pkc);
295 } hal_pkc_callback_t;
296
306 /* Exported constants --------------------------------------------------------*/
314 #define HAL_PKC_ERROR_NONE ((uint32_t)0x00000000)
315 #define HAL_PKC_ERROR_TIMEOUT ((uint32_t)0x00000001)
316 #define HAL_PKC_ERROR_TRANSFER ((uint32_t)0x00000002)
317 #define HAL_PKC_ERROR_OVERFLOW ((uint32_t)0x00000004)
318 #define HAL_PKC_ERROR_INVALID_PARAM ((uint32_t)0x00000008)
319 #define HAL_PKC_ERROR_INVERSE_K ((uint32_t)0x00000010)
320 #define HAL_PKC_ERROR_IRREVERSIBLE ((uint32_t)0x00000020)
326 #define PKC_SECURE_MODE_DISABLE ((uint32_t)0x00000000)
327 #define PKC_SECURE_MODE_ENABLE ((uint32_t)0x00000001)
333 #define PKC_OPERATION_MODE_MULTI LL_PKC_operation_mode_MULTIPLY
334 #define PKC_OPERATION_MODE_INVER LL_PKC_operation_mode_INVERTION
335 #define PKC_OPERATION_MODE_ADD LL_PKC_operation_mode_ADD
336 #define PKC_OPERATION_MODE_SUB LL_PKC_operation_mode_SUB
337 #define PKC_OPERATION_MODE_CMP LL_PKC_operation_mode_COMPARE
338 #define PKC_OPERATION_MODE_LSHIFT LL_PKC_operation_mode_LEFTSHIFT
339 #define PKC_OPERATION_MODE_BIGMULTI LL_PKC_operation_mode_BIGINTEGERMULTIPLY
340 #define PKC_OPERATION_MODE_BIGADD LL_PKC_operation_mode_BIGINTEGERADD
346 #define PKC_BITS_LENGTH_MIN LL_PKC_BITS_LENGTH_MIN
347 #define PKC_BITS_LENGTH_MAX LL_PKC_BITS_LENGTH_MAX
348 #define PKC_BIGMULTI_BITS_LENGTH_MAX LL_PKC_BIGMULTI_BITS_LENGTH_MAX
354 #define PKC_FLAG_BUSY LL_PKC_WORKSTAT_BUSY
360 #define PKC_IT_DONE LL_PKC_INTEN_DONE
361 #define PKC_IT_ERR LL_PKC_INTEN_ERR
362 #define PKC_IT_OVF LL_PKC_INTEN_BAOVF
368 #define HAL_PKC_TIMEOUT_DEFAULT_VALUE ((uint32_t)5000)
373 /* Exported macro ------------------------------------------------------------*/
374
382 #define __HAL_PKC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->state = HAL_PKC_STATE_RESET)
383
388 #define __HAL_PKC_RESET(__HANDLE__) CLEAR_BITS((__HANDLE__)->p_instance->CTRL, PKC_CTRL_SWRST); \
389 SET_BITS((__HANDLE__)->p_instance->CTRL, PKC_CTRL_SWRST)
390
395 #define __HAL_PKC_ENABLE(__HANDLE__) SET_BITS((__HANDLE__)->p_instance->CTRL, PKC_CTRL_EN)
396
401 #define __HAL_PKC_DISABLE(__HANDLE__) CLEAR_BITS((__HANDLE__)->p_instance->CTRL, PKC_CTRL_EN)
402
412 #define __HAL_PKC_ENABLE_IT(__HANDLE__, __INTERRUPT__) SET_BITS((__HANDLE__)->p_instance->INTEN, (__INTERRUPT__))
413
423 #define __HAL_PKC_DISABLE_IT(__HANDLE__, __INTERRUPT__) CLEAR_BITS((__HANDLE__)->p_instance->INTEN, (__INTERRUPT__))
424
434 #define __HAL_PKC_GET_FLAG_IT(__HANDLE__, __FLAG__) (READ_BITS((__HANDLE__)->p_instance->INTSTAT, (__FLAG__)) == (__FLAG__))
435
445 #define __HAL_PKC_CLEAR_FLAG_IT(__HANDLE__, __FLAG__) SET_BITS((__HANDLE__)->p_instance->INTSTAT, (__FLAG__))
446
454 #define __HAL_PKC_GET_FLAG(__HANDLE__, __FLAG__) ((READ_BITS((__HANDLE__)->p_instance->WORKSTAT, (__FLAG__)) != 0) ? SET : RESET)
455
458 /* Private macros ------------------------------------------------------------*/
467 #define IS_PKC_BITS_LENGTH(__BITS__) (((__BITS__) >= PKC_BITS_LENGTH_MIN) && ((__BITS__) <= PKC_BITS_LENGTH_MAX))
468
473 #define IS_PKC_BIGMULTI_BITS_LENGTH(__BITS__) (((__BITS__) >= PKC_BITS_LENGTH_MIN) && ((__BITS__) <= PKC_BIGMULTI_BITS_LENGTH_MAX))
474
479 #define IS_PKC_SECURE_MODE(__MODE__) (((__MODE__) == PKC_SECURE_MODE_DISABLE) || \
480 ((__MODE__) == PKC_SECURE_MODE_ENABLE))
481
486 #define IS_PKC_OPERATION_MODE(__MODE__) (((__MODE__) == PKC_OPERATION_MODE_MULTI) || \
487 ((__MODE__) == PKC_OPERATION_MODE_INVER) || \
488 ((__MODE__) == PKC_OPERATION_MODE_ADD) || \
489 ((__MODE__) == PKC_OPERATION_MODE_SUB) || \
490 ((__MODE__) == PKC_OPERATION_MODE_CMP) || \
491 ((__MODE__) == PKC_OPERATION_MODE_LSHIFT) || \
492 ((__MODE__) == PKC_OPERATION_MODE_BIGMULTI) || \
493 ((__MODE__) == PKC_OPERATION_MODE_BIGADD))
494
501 /* Exported functions --------------------------------------------------------*/
545 hal_status_t hal_pkc_init(pkc_handle_t *p_pkc);
546
558 hal_status_t hal_pkc_deinit(pkc_handle_t *p_pkc);
559
569 void hal_pkc_msp_init(pkc_handle_t *p_pkc);
570
580 void hal_pkc_msp_deinit(pkc_handle_t *p_pkc);
581
624 hal_status_t hal_pkc_rsa_modular_exponent(pkc_handle_t *p_pkc, pkc_rsa_modular_exponent_t *p_input, uint32_t timeout);
625
640 hal_status_t hal_pkc_ecc_point_multi(pkc_handle_t *p_pkc, pkc_ecc_point_multi_t *p_input, uint32_t timeout);
641
655 hal_status_t hal_pkc_ecc_point_multi_it(pkc_handle_t *p_pkc, pkc_ecc_point_multi_t *p_input);
656
671 hal_status_t hal_pkc_modular_add(pkc_handle_t *p_pkc, pkc_modular_add_t *p_input, uint32_t timeout);
672
686 hal_status_t hal_pkc_modular_add_it(pkc_handle_t *p_pkc, pkc_modular_add_t *p_input);
687
702 hal_status_t hal_pkc_modular_sub(pkc_handle_t *p_pkc, pkc_modular_sub_t *p_input, uint32_t timeout);
703
717 hal_status_t hal_pkc_modular_sub_it(pkc_handle_t *p_pkc, pkc_modular_sub_t *p_input);
718
733 hal_status_t hal_pkc_modular_left_shift(pkc_handle_t *p_pkc, pkc_modular_shift_t *p_input, uint32_t timeout);
734
748 hal_status_t hal_pkc_modular_left_shift_it(pkc_handle_t *p_pkc, pkc_modular_shift_t *p_input);
749
764 hal_status_t hal_pkc_modular_compare(pkc_handle_t *p_pkc, pkc_modular_compare_t *p_input, uint32_t timeout);
765
779 hal_status_t hal_pkc_modular_compare_it(pkc_handle_t *p_pkc, pkc_modular_compare_t *p_input);
780
795 hal_status_t hal_pkc_montgomery_multi(pkc_handle_t *p_pkc, pkc_montgomery_multi_t *p_input, uint32_t timeout);
796
810 hal_status_t hal_pkc_montgomery_multi_it(pkc_handle_t *p_pkc, pkc_montgomery_multi_t *p_input);
811
826 hal_status_t hal_pkc_montgomery_inversion(pkc_handle_t *p_pkc, pkc_montgomery_inversion_t *p_input, uint32_t timeout);
827
841 hal_status_t hal_pkc_montgomery_inversion_it(pkc_handle_t *p_pkc, pkc_montgomery_inversion_t *p_input);
842
857 hal_status_t hal_pkc_big_number_multi(pkc_handle_t *p_pkc, pkc_big_number_multi_t *p_input, uint32_t timeout);
858
872 hal_status_t hal_pkc_big_number_multi_it(pkc_handle_t *p_pkc, pkc_big_number_multi_t *p_input);
873
888 hal_status_t hal_pkc_big_number_add(pkc_handle_t *p_pkc, pkc_big_number_add_t *p_input, uint32_t timeout);
889
903 hal_status_t hal_pkc_big_number_add_it(pkc_handle_t *p_pkc, pkc_big_number_add_t *p_input);
904
919 void hal_pkc_irq_handler(pkc_handle_t *p_pkc);
920
928 void hal_pkc_done_callback(pkc_handle_t *p_pkc);
929
937 void hal_pkc_error_callback(pkc_handle_t *p_pkc);
938
946 void hal_pkc_overflow_callback(pkc_handle_t *p_pkc);
947
979 hal_pkc_state_t hal_pkc_get_state(pkc_handle_t *p_pkc);
980
989 uint32_t hal_pkc_get_error(pkc_handle_t *p_pkc);
990
999 void hal_pkc_set_timeout(pkc_handle_t *p_pkc, uint32_t timeout);
1000
1013 hal_status_t hal_pkc_suspend_reg(pkc_handle_t *p_pkc);
1027 hal_status_t hal_pkc_resume_reg(pkc_handle_t *p_pkc);
1028
1033 #ifdef __cplusplus
1034 }
1035 #endif
1036
1037 #endif /* __GR55xx_HAL_PKC_H__ */
1038
hal_pkc_rsa_modular_exponent
hal_status_t hal_pkc_rsa_modular_exponent(pkc_handle_t *p_pkc, pkc_rsa_modular_exponent_t *p_input, uint32_t timeout)
Execute RSA Modular Exponentiation in blocking mode.
hal_pkc_montgomery_multi
hal_status_t hal_pkc_montgomery_multi(pkc_handle_t *p_pkc, pkc_montgomery_multi_t *p_input, uint32_t timeout)
Execute Montgomery Modular Multiplication in blocking mode.
_pkc_modular_sub::p_B
uint32_t * p_B
Definition: gr55xx_hal_pkc.h:202
_pkc_modular_add::p_B
uint32_t * p_B
Definition: gr55xx_hal_pkc.h:191
_pkc_big_number_add::p_A
uint32_t * p_A
Definition: gr55xx_hal_pkc.h:268
_pkc_handle::p_instance
pkc_regs_t * p_instance
Definition: gr55xx_hal_pkc.h:135
_pkc_montgomery_multi::ConstP
uint32_t ConstP
Definition: gr55xx_hal_pkc.h:236
_pkc_handle::shift_count
uint32_t shift_count
Definition: gr55xx_hal_pkc.h:141
HAL_PKC_STATE_RESET
@ HAL_PKC_STATE_RESET
Definition: gr55xx_hal_pkc.h:77
hal_lock_t
hal_lock_t
HAL Lock structures definition.
Definition: gr55xx_hal_def.h:81
_pkc_montgomery_multi
PKC Montgomery Modular Multiplication expression input.
Definition: gr55xx_hal_pkc.h:232
hal_pkc_modular_sub
hal_status_t hal_pkc_modular_sub(pkc_handle_t *p_pkc, pkc_modular_sub_t *p_input, uint32_t timeout)
Execute Modular Subtraction in blocking mode.
_pkc_modular_shift::shift_bits
uint32_t shift_bits
Definition: gr55xx_hal_pkc.h:213
_pkc_ecc_point_multi::p_ecc_point
ecc_point_t * p_ecc_point
Definition: gr55xx_hal_pkc.h:168
_pkc_modular_sub::p_P
uint32_t * p_P
Definition: gr55xx_hal_pkc.h:203
_pkc_montgomery_multi::p_A
uint32_t * p_A
Definition: gr55xx_hal_pkc.h:233
_pkc_montgomery_inversion
PKC Montgomery Inversion expression input.
Definition: gr55xx_hal_pkc.h:245
_pkc_big_number_add::p_B
uint32_t * p_B
Definition: gr55xx_hal_pkc.h:269
hal_pkc_montgomery_inversion
hal_status_t hal_pkc_montgomery_inversion(pkc_handle_t *p_pkc, pkc_montgomery_inversion_t *p_input, uint32_t timeout)
Execute Montgomery Inversion in blocking mode.
_pkc_modular_shift
PKC Modular Left Shift expression input.
Definition: gr55xx_hal_pkc.h:211
hal_pkc_modular_compare
hal_status_t hal_pkc_modular_compare(pkc_handle_t *p_pkc, pkc_modular_compare_t *p_input, uint32_t timeout)
Execute Modular Comparison in blocking mode.
pkc_montgomery_inversion_t
struct _pkc_montgomery_inversion pkc_montgomery_inversion_t
PKC Montgomery Inversion expression input.
_pkc_montgomery_inversion::p_P
uint32_t * p_P
Definition: gr55xx_hal_pkc.h:247
hal_pkc_resume_reg
hal_status_t hal_pkc_resume_reg(pkc_handle_t *p_pkc)
Restore some registers related to PKC configuration after sleep. This function must be used in conjun...
hal_pkc_ecc_point_multi
hal_status_t hal_pkc_ecc_point_multi(pkc_handle_t *p_pkc, pkc_ecc_point_multi_t *p_input, uint32_t timeout)
Execute ECC Point Multiplication in blocking mode.
_pkc_handle::state
__IO hal_pkc_state_t state
Definition: gr55xx_hal_pkc.h:147
_hal_pkc_callback::pkc_error_callback
void(* pkc_error_callback)(pkc_handle_t *p_pkc)
Definition: gr55xx_hal_pkc.h:293
HAL_PKC_STATE_READY
@ HAL_PKC_STATE_READY
Definition: gr55xx_hal_pkc.h:78
_pkc_modular_compare
PKC Modular Comparison expression input.
Definition: gr55xx_hal_pkc.h:222
_pkc_handle::error_code
__IO uint32_t error_code
Definition: gr55xx_hal_pkc.h:149
_pkc_modular_add::p_A
uint32_t * p_A
Definition: gr55xx_hal_pkc.h:190
pkc_init_t::p_ecc_curve
ecc_curve_init_t * p_ecc_curve
Definition: gr55xx_hal_pkc.h:112
_pkc_handle::retention
uint32_t retention[1]
Definition: gr55xx_hal_pkc.h:153
_pkc_modular_shift::p_P
uint32_t * p_P
Definition: gr55xx_hal_pkc.h:214
hal_pkc_modular_left_shift_it
hal_status_t hal_pkc_modular_left_shift_it(pkc_handle_t *p_pkc, pkc_modular_shift_t *p_input)
Execute Modular Left Shift in non-blocking mode with Interrupt.
_pkc_handle
PKC handle Structure definition.
Definition: gr55xx_hal_pkc.h:134
_pkc_big_number_add
PKC Big Number Addition expression input.
Definition: gr55xx_hal_pkc.h:267
hal_pkc_init
hal_status_t hal_pkc_init(pkc_handle_t *p_pkc)
Initialize the PKC according to the specified parameters in the pkc_init_t and initialize the associa...
hal_pkc_get_state
hal_pkc_state_t hal_pkc_get_state(pkc_handle_t *p_pkc)
Return the PKC handle state.
HAL_PKC_STATE_TIMEOUT
@ HAL_PKC_STATE_TIMEOUT
Definition: gr55xx_hal_pkc.h:81
gr55xx_ll_pkc.h
Header file containing functions prototypes of PKC LL library.
_pkc_montgomery_multi::p_B
uint32_t * p_B
Definition: gr55xx_hal_pkc.h:234
_ll_ecc_curve_init
LL PKC ECC P-256 Elliptic Curve Init Structure definition.
Definition: gr55xx_ll_pkc.h:103
_pkc_handle::p_P
uint32_t * p_P
Definition: gr55xx_hal_pkc.h:143
pkc_modular_sub_t
struct _pkc_modular_sub pkc_modular_sub_t
PKC Modular Subtraction expression input.
hal_pkc_deinit
hal_status_t hal_pkc_deinit(pkc_handle_t *p_pkc)
De-initialize the PKC peripheral.
_pkc_ecc_point_multi::p_K
uint32_t * p_K
Definition: gr55xx_hal_pkc.h:167
_pkc_modular_add::p_P
uint32_t * p_P
Definition: gr55xx_hal_pkc.h:192
hal_pkc_suspend_reg
hal_status_t hal_pkc_suspend_reg(pkc_handle_t *p_pkc)
Suspend some registers related to PKC configuration before sleep.
_pkc_handle::lock
__IO hal_lock_t lock
Definition: gr55xx_hal_pkc.h:145
pkc_ecc_point_multi_t
struct _pkc_ecc_point_multi pkc_ecc_point_multi_t
PKC ECC Point Multiplication expression input.
pkc_big_number_multi_t
struct _pkc_big_number_multi pkc_big_number_multi_t
PKC Big Number Multiplication expression input.
hal_pkc_montgomery_multi_it
hal_status_t hal_pkc_montgomery_multi_it(pkc_handle_t *p_pkc, pkc_montgomery_multi_t *p_input)
Execute Montgomery Modular Multiplication in non-blocking mode with Interrupt.
hal_pkc_modular_add
hal_status_t hal_pkc_modular_add(pkc_handle_t *p_pkc, pkc_modular_add_t *p_input, uint32_t timeout)
Execute Modular Addition in blocking mode.
_pkc_big_number_multi::p_A
uint32_t * p_A
Definition: gr55xx_hal_pkc.h:258
pkc_init_t::secure_mode
uint32_t secure_mode
Definition: gr55xx_hal_pkc.h:116
hal_pkc_modular_sub_it
hal_status_t hal_pkc_modular_sub_it(pkc_handle_t *p_pkc, pkc_modular_sub_t *p_input)
Execute Modular Subtraction in non-blocking mode with Interrupt.
pkc_init_t
PKC Init Structure definition.
Definition: gr55xx_hal_pkc.h:111
hal_pkc_msp_init
void hal_pkc_msp_init(pkc_handle_t *p_pkc)
Initialize the PKC MSP.
HAL_PKC_STATE_ERROR
@ HAL_PKC_STATE_ERROR
Definition: gr55xx_hal_pkc.h:80
_pkc_modular_sub
PKC Modular Subtraction expression input.
Definition: gr55xx_hal_pkc.h:200
pkc_modular_compare_t
struct _pkc_modular_compare pkc_modular_compare_t
PKC Modular Comparison expression input.
_pkc_modular_compare::p_A
uint32_t * p_A
Definition: gr55xx_hal_pkc.h:223
_pkc_rsa_modular_exponent::p_P_R2
uint32_t * p_P_R2
Definition: gr55xx_hal_pkc.h:180
hal_pkc_msp_deinit
void hal_pkc_msp_deinit(pkc_handle_t *p_pkc)
De-initialize the PKC MSP.
_pkc_montgomery_inversion::ConstP
uint32_t ConstP
Definition: gr55xx_hal_pkc.h:248
_pkc_handle::init
pkc_init_t init
Definition: gr55xx_hal_pkc.h:137
hal_pkc_overflow_callback
void hal_pkc_overflow_callback(pkc_handle_t *p_pkc)
PKC over flow callback.
_pkc_handle::p_result
void * p_result
Definition: gr55xx_hal_pkc.h:139
_pkc_handle::timeout
uint32_t timeout
Definition: gr55xx_hal_pkc.h:151
_pkc_rsa_modular_exponent::ConstP
uint32_t ConstP
Definition: gr55xx_hal_pkc.h:181
_ll_ecc_point
LL PKC ECC Point Structure definition.
Definition: gr55xx_ll_pkc.h:92
_pkc_modular_sub::p_A
uint32_t * p_A
Definition: gr55xx_hal_pkc.h:201
_hal_pkc_callback::pkc_done_callback
void(* pkc_done_callback)(pkc_handle_t *p_pkc)
Definition: gr55xx_hal_pkc.h:292
_pkc_ecc_point_multi
PKC ECC Point Multiplication expression input.
Definition: gr55xx_hal_pkc.h:166
pkc_big_number_add_t
struct _pkc_big_number_add pkc_big_number_add_t
PKC Big Number Addition expression input.
hal_pkc_modular_left_shift
hal_status_t hal_pkc_modular_left_shift(pkc_handle_t *p_pkc, pkc_modular_shift_t *p_input, uint32_t timeout)
Execute Modular Left Shift in blocking mode.
pkc_modular_shift_t
struct _pkc_modular_shift pkc_modular_shift_t
PKC Modular Left Shift expression input.
_pkc_rsa_modular_exponent::p_B
uint32_t * p_B
Definition: gr55xx_hal_pkc.h:178
pkc_init_t::data_bits
uint32_t data_bits
Definition: gr55xx_hal_pkc.h:114
hal_status_t
hal_status_t
HAL Status structures definition.
Definition: gr55xx_hal_def.h:70
hal_pkc_done_callback
void hal_pkc_done_callback(pkc_handle_t *p_pkc)
PKC calculate done callback.
_pkc_big_number_multi::p_B
uint32_t * p_B
Definition: gr55xx_hal_pkc.h:259
_pkc_rsa_modular_exponent::p_A
uint32_t * p_A
Definition: gr55xx_hal_pkc.h:177
_pkc_montgomery_inversion::p_A
uint32_t * p_A
Definition: gr55xx_hal_pkc.h:246
hal_pkc_big_number_add_it
hal_status_t hal_pkc_big_number_add_it(pkc_handle_t *p_pkc, pkc_big_number_add_t *p_input)
Execute Big Number Addition in non-blocking mode with Interrupt.
_pkc_montgomery_multi::p_P
uint32_t * p_P
Definition: gr55xx_hal_pkc.h:235
hal_pkc_modular_add_it
hal_status_t hal_pkc_modular_add_it(pkc_handle_t *p_pkc, pkc_modular_add_t *p_input)
Execute Modular Addition in non-blocking mode with Interrupt.
hal_pkc_error_callback
void hal_pkc_error_callback(pkc_handle_t *p_pkc)
PKC error callback.
hal_pkc_big_number_add
hal_status_t hal_pkc_big_number_add(pkc_handle_t *p_pkc, pkc_big_number_add_t *p_input, uint32_t timeout)
Execute Big Number Addition in blocking mode.
hal_pkc_montgomery_inversion_it
hal_status_t hal_pkc_montgomery_inversion_it(pkc_handle_t *p_pkc, pkc_montgomery_inversion_t *p_input)
Execute Montgomery Inversion in non-blocking mode with Interrupt.
hal_pkc_big_number_multi_it
hal_status_t hal_pkc_big_number_multi_it(pkc_handle_t *p_pkc, pkc_big_number_multi_t *p_input)
Execute Big Number Multiplication in non-blocking mode with Interrupt.
HAL_PKC_STATE_BUSY
@ HAL_PKC_STATE_BUSY
Definition: gr55xx_hal_pkc.h:79
hal_pkc_modular_compare_it
hal_status_t hal_pkc_modular_compare_it(pkc_handle_t *p_pkc, pkc_modular_compare_t *p_input)
Execute Modular Comparison in non-blocking mode with Interrupt.
hal_pkc_irq_handler
void hal_pkc_irq_handler(pkc_handle_t *p_pkc)
Handle PKC interrupt request.
pkc_modular_add_t
struct _pkc_modular_add pkc_modular_add_t
PKC Modular Addition expression input.
_hal_pkc_callback
HAL_PKC Callback function definition.
Definition: gr55xx_hal_pkc.h:289
_pkc_modular_add
PKC Modular Addition expression input.
Definition: gr55xx_hal_pkc.h:189
_pkc_big_number_multi
PKC Big Number Multiplication expression input.
Definition: gr55xx_hal_pkc.h:257
_pkc_modular_shift::p_A
uint32_t * p_A
Definition: gr55xx_hal_pkc.h:212
pkc_rsa_modular_exponent_t
struct _pkc_rsa_modular_exponent pkc_rsa_modular_exponent_t
PKC RSA Modular Exponentiation expression input.
hal_pkc_state_t
hal_pkc_state_t
HAL PKC State Enumerations definition.
Definition: gr55xx_hal_pkc.h:76
_hal_pkc_callback::pkc_msp_deinit
void(* pkc_msp_deinit)(pkc_handle_t *p_pkc)
Definition: gr55xx_hal_pkc.h:291
_hal_pkc_callback::pkc_overflow_callback
void(* pkc_overflow_callback)(pkc_handle_t *p_pkc)
Definition: gr55xx_hal_pkc.h:294
hal_pkc_callback_t
struct _hal_pkc_callback hal_pkc_callback_t
HAL_PKC Callback function definition.
_pkc_rsa_modular_exponent::p_P
uint32_t * p_P
Definition: gr55xx_hal_pkc.h:179
_pkc_modular_compare::p_P
uint32_t * p_P
Definition: gr55xx_hal_pkc.h:224
pkc_handle_t
struct _pkc_handle pkc_handle_t
PKC handle Structure definition.
_hal_pkc_callback::pkc_msp_init
void(* pkc_msp_init)(pkc_handle_t *p_pkc)
Definition: gr55xx_hal_pkc.h:290
_pkc_rsa_modular_exponent
PKC RSA Modular Exponentiation expression input.
Definition: gr55xx_hal_pkc.h:176
pkc_montgomery_multi_t
struct _pkc_montgomery_multi pkc_montgomery_multi_t
PKC Montgomery Modular Multiplication expression input.
hal_pkc_get_error
uint32_t hal_pkc_get_error(pkc_handle_t *p_pkc)
Return the PKC error code.
hal_pkc_big_number_multi
hal_status_t hal_pkc_big_number_multi(pkc_handle_t *p_pkc, pkc_big_number_multi_t *p_input, uint32_t timeout)
Execute Big Number Multiplication in blocking mode.
gr55xx_hal_def.h
This file contains HAL common definitions, enumeration, macros and structures definitions.
hal_pkc_set_timeout
void hal_pkc_set_timeout(pkc_handle_t *p_pkc, uint32_t timeout)
Set the PKC internal process timeout value.
hal_pkc_ecc_point_multi_it
hal_status_t hal_pkc_ecc_point_multi_it(pkc_handle_t *p_pkc, pkc_ecc_point_multi_t *p_input)
Execute ECC Point Multiplication in non-blocking mode with Interrupt.