Skip to content
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

Cherry-Pick from #34310 from master branch: [Infineon] Trust M Code clean up and improve crypto performance #34466

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,7 @@ CHIP_ERROR P256PublicKey::ECDSA_validate_hash_signature(const uint8_t * hash, si
size_t signature_trustm_len = sizeof(signature_trustm);
MutableByteSpan out_der_sig_span(signature_trustm, signature_trustm_len);

uint8_t hash_length_u8 = static_cast<uint8_t>(hash_length);
uint16_t signature_trustm_len_u16 = static_cast<uint16_t>(signature_trustm_len);
uint8_t hash_length_u8 = static_cast<uint8_t>(hash_length);

VerifyOrReturnError(hash != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
VerifyOrReturnError(hash_length > 0, CHIP_ERROR_INVALID_ARGUMENT);
Expand All @@ -292,7 +291,7 @@ CHIP_ERROR P256PublicKey::ECDSA_validate_hash_signature(const uint8_t * hash, si

signature_trustm_len = out_der_sig_span.size();
// ECC verify
return_status = trustm_ecdsa_verify((uint8_t *) hash, hash_length_u8, (uint8_t *) signature_trustm, signature_trustm_len_u16,
return_status = trustm_ecdsa_verify((uint8_t *) hash, hash_length_u8, (uint8_t *) signature_trustm, signature_trustm_len,
(uint8_t *) bytes, (uint8_t) kP256_PublicKey_Length);

VerifyOrExit(return_status == OPTIGA_LIB_SUCCESS, error = CHIP_ERROR_INTERNAL);
Expand Down
Loading
Loading