-
Notifications
You must be signed in to change notification settings - Fork 836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New additions for MAXQ with wolfPKCS11 #8343
base: master
Are you sure you want to change the base?
Conversation
anhu
commented
Jan 8, 2025
- Support using MAXQ for:
- AES-ECB
- AES-CCM
- AES-CBC
- ECC Key Generation and ECDH
- in wc_ecc_import_private_key_ex():
- check to make sure devId is not invalid before calling wc_MAXQ10XX_EccSetKey().
- This is because the raspberry pi sometimes need to sign stuff.
- in aes_set_key() and ecc_set_key():
- delete a key in case it already exists; ignore error since it might not exist.
- unlock, lock the HW mutex around ECDSA_sign() because it needs access to rng
- in wolfSSL_MAXQ10XX_CryptoDevCb:
- allow maxq1065 to call the crypto callback.
- do not set the key during signing; use pre provisioned one instead (DEVICE_KEY_PAIR_OBJ_ID)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work
wolfcrypt/src/port/maxim/maxq10xx.c
Outdated
return rc; | ||
} | ||
|
||
memset(fixed_info, 0xaa, fixed_info_len); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use XMEMSET
wolfcrypt/src/port/maxim/maxq10xx.c
Outdated
/* Output contains the public key and shared secret concatenated. The public | ||
* key is (0x04 || X || Y) which means its 65 bytes. The shared secret is | ||
* in the 32 bytes after that. */ | ||
memcpy(ss, &output[65], *ss_len); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XMEMCPY
- Support using MAXQ for: - AES-ECB - AES-CCM - AES-CBC - ECC Key Generation and ECDH - in wc_ecc_import_private_key_ex(): - check to make sure devId is not invalid before calling wc_MAXQ10XX_EccSetKey(). - This is because the raspberry pi sometimes need to sign stuff. - in aes_set_key() and ecc_set_key(): - delete a key in case it already exists; ignore error since it might not exist. - unlock, lock the HW mutex around ECDSA_sign() because it needs access to rng - in wolfSSL_MAXQ10XX_CryptoDevCb: - allow maxq1065 to call the crypto callback. - do not set the key during signing; use pre provisioned one instead (DEVICE_KEY_PAIR_OBJ_ID)