@@ -219,7 +219,7 @@ static psa_status_t atecc608a_import_public_key(psa_key_slot_number_t key_slot,
219
219
220
220
ASSERT_SUCCESS_PSA (atecc608a_init ());
221
221
222
- ASSERT_SUCCESS (atcab_write_pubkey (key_id , pubkey_for_driver (p_data )));
222
+ ASSERT_SUCCESS (atcab_write_pubkey (key_id , pubkey_for_driver (( uint8_t * ) p_data )));
223
223
exit :
224
224
atecc608a_deinit ();
225
225
return status ;
@@ -367,6 +367,42 @@ psa_status_t atecc608a_asymmetric_verify(psa_key_slot_number_t key_slot,
367
367
return status ;
368
368
}
369
369
370
+ psa_status_t atecc608a_write (uint16_t slot , size_t offset , const uint8_t * data , size_t length )
371
+ {
372
+ psa_status_t status = PSA_ERROR_GENERIC_ERROR ;
373
+
374
+ /* The hardware has slots 0-15 */
375
+ if (slot > 15 )
376
+ {
377
+ return PSA_ERROR_INVALID_ARGUMENT ;
378
+ }
379
+
380
+ ASSERT_SUCCESS_PSA (atecc608a_init ());
381
+ ASSERT_SUCCESS (atcab_write_bytes_zone (ATCA_ZONE_DATA , slot , offset , data , length ));
382
+
383
+ exit :
384
+ atecc608a_deinit ();
385
+ return status ;
386
+ }
387
+
388
+ psa_status_t atecc608a_read (uint16_t slot , size_t offset , uint8_t * data , size_t length )
389
+ {
390
+ psa_status_t status = PSA_ERROR_GENERIC_ERROR ;
391
+
392
+ /* The hardware has slots 0-15 */
393
+ if (slot > 15 )
394
+ {
395
+ return PSA_ERROR_INVALID_ARGUMENT ;
396
+ }
397
+
398
+ ASSERT_SUCCESS_PSA (atecc608a_init ());
399
+ ASSERT_SUCCESS (atcab_read_bytes_zone (ATCA_ZONE_DATA , slot , offset , data , length ));
400
+
401
+ exit :
402
+ atecc608a_deinit ();
403
+ return status ;
404
+ }
405
+
370
406
#define PSA_ATECC608A_LIFETIME 0xdeadbeefU
371
407
372
408
static psa_drv_se_asymmetric_t atecc608a_asymmetric =
0 commit comments