crypto:add some hardware support

esp32c3: aes hmac-sha1 hmac-sha256
stm32f0l0g0 stm32l1 : aes
sam34: aes
lpc43: aes
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
anjiahao
2022-09-08 14:13:08 +08:00
committed by Xiang Xiao
parent 3d2f0c0e27
commit bc0fe0ea16
20 changed files with 1440 additions and 53 deletions
+10
View File
@@ -313,6 +313,11 @@ struct crypt_op
caddr_t iv;
};
/* hamc buffer, software & hardware need it */
extern const uint8_t hmac_ipad_buffer[HMAC_MAX_BLOCK_LEN];
extern const uint8_t hmac_opad_buffer[HMAC_MAX_BLOCK_LEN];
#define CRYPTO_MAX_MAC_LEN 20
/* done against open of /dev/crypto, to get a cloned descriptor.
@@ -344,4 +349,9 @@ int crypto_getfeat(FAR int *);
FAR struct cryptop *crypto_getreq(int);
void crypto_freereq(FAR struct cryptop *);
#ifdef CONFIG_CRYPTO_CRYPTODEV_HARDWARE
void hwcr_init(void);
#endif
#endif /* __INCLUDE_CRYPTO_CRYPTODEV_H */
-3
View File
@@ -73,9 +73,6 @@ struct swcr_data
struct swcr_data *sw_next;
};
extern const uint8_t hmac_ipad_buffer[HMAC_MAX_BLOCK_LEN];
extern const uint8_t hmac_opad_buffer[HMAC_MAX_BLOCK_LEN];
int swcr_encdec(FAR struct cryptop *, FAR struct cryptodesc *,
FAR struct swcr_data *, caddr_t);
int swcr_authcompute(FAR struct cryptop *, FAR struct cryptodesc *,