Thank you for your response.
We would like to implement a digital signature verification function.
Please forgive the lengthy explanation.
The configuration consists of data from a client (KW45B41Z-EVK board), signed by the server and verified with a public key. (Signatures and public keys are generated using OpenSSL or similar).
It has been confirmed that the public key and signature generated by the server can be correctly verified by the Python signature verification programme.
Having verified that the private key, public key, signature data and signature are generated correctly, the next step is to check whether the same can be achieved with the program implemented on the KW45B41Z-EVK board.
After checking the security library, we thought that the verification functions defined in <SecLib_ecp256.h> could be used, so we implemented and verified them.
The function used was the following function.
----------------------------------------------------------
ECDSA_VerifySignature(const uint8_t *pPubKey,
const uint8_t *pDigest,.
uint16_t DigestLen,.
const uint8_t *pSignature);
[size of parameters used].
pPubKey: previously known public key (91 bytes)
pDigest: hash value (32 bytes) generated by SHA256 function.
DigestLen : 32
pSignature: 70 bytes
----------------------------------------------------------
The result was not Success.
We are investigating that the ECDSA_VerifySignature function may have been used incorrectly, but the cause has not been identified.
Corresponding function comment in <SecLib_ecp256.h>.
-------------------------------------------
* @Param [in] pPubKey Pointer to a 64 byte buffer containing the public key (x,y).
* The public key is stored as a concatenation x||y with x and y being in BE format.
* @Param [in] pDigest Pointer to a buffer of byte length digestLen containing the message digest in BE format.
* @Param [in] DigestLen Byte length of the passed message digest.
* @Param [in] pSignature Pointer to a 64 byte buffer containing the generated signature (r,s).
* The signature is stored as the concatenation r||s with the integers r and s being in BE
* format.
-------------------------------------------
This comment states that it is a 64 byte buffer and I was wondering if the public key and signature parameters I am trying to use cannot possibly be used in the ECDSA_VerifySignature function, so I asked the community members a question.
There was also a statement that format = big endian, so I tried reversing the order of the data, but the result was the same NG.
Thank you in advance for your help.