20
20
* limitations under the License.
21
21
*/
22
22
#include "atecc608a_se.h"
23
-
24
- #include "psa/crypto.h"
25
-
26
- #include "atca_basic.h"
27
23
#include "atca_helpers.h"
28
24
29
25
#ifdef DEBUG_PRINT
36
32
/* Uncomment to print results on success */
37
33
//#define DEBUG_PRINT
38
34
39
- #define ATCAB_INIT () \
40
- do \
41
- { \
42
- if (atcab_init(&atca_iface_config) != ATCA_SUCCESS) \
43
- { \
44
- status = PSA_ERROR_HARDWARE_FAILURE; \
45
- goto exit; \
46
- } \
47
- } while(0)
48
-
49
- /** `atcab_release()` might return `ATCA_BAD_PARAM` if there is no global device
50
- * initialized via `atcab_init()`. HAL might return an error if an i2c device
51
- * cannot be released, but in current implementations it always returns
52
- * `ATCA_SUCCESS` - therefore we are ignoring the return code. */
53
- #define ATCAB_DEINIT () \
54
- do \
55
- { \
56
- atcab_release(); \
57
- } while(0)
58
-
59
35
/** This macro checks if the result of an `expression` is equal to an
60
36
* `expected` value and sets a `status` variable of type `psa_status_t` to
61
37
* `PSA_SUCCESS`. If they are not equal, the `status` is set to
77
53
#define ASSERT_SUCCESS (expression ) ASSERT_STATUS(expression, ATCA_SUCCESS, \
78
54
atecc608a_to_psa_error(ASSERT_result))
79
55
80
- static ATCAIfaceCfg atca_iface_config = {
56
+ ATCAIfaceCfg atca_iface_config = {
81
57
.iface_type = ATCA_I2C_IFACE ,
82
58
.devtype = ATECC608A ,
83
59
.atcai2c .slave_address = 0xC0 ,
@@ -87,7 +63,7 @@ static ATCAIfaceCfg atca_iface_config = {
87
63
.rx_retries = 20 ,
88
64
};
89
65
90
- static psa_status_t atecc608a_to_psa_error (ATCA_STATUS ret )
66
+ psa_status_t atecc608a_to_psa_error (ATCA_STATUS ret )
91
67
{
92
68
switch (ret )
93
69
{
0 commit comments