cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 Crypto Library - Wrong ED25519 Signature?

MMax.1
Associate

I am trying to sign and verify messages with the STM32 CryptoLibrary and the ED25519 signing functionality.

But the created signature is not the same as the created ED25519 signature created with the CryptoPP library.

My code for generating a signature with STM32 CryptoLibrary and ED25519 is this:

const uint8_t privateSigningKey[32] = { ... }; 
 
char *mbBuffer = "H";
int32_t mbLength = 1; 
 
// sign message
uint8_t signature[64];
int32_t status = ED25519sign(signature, (uint8_t *) mbBuffer, mbLength,   privateSigningKey);

This code produces the following signature:

a9ac43ecee622060e31f3453224f4bb8af735cf58224caccf2a54a389907098d7c81bb7129292d3b2aac2a5c22a1baa45c218c32edd1e8a68396ca8cf7477307

However creating a signature with the CryptoPP library over the string: "H", returns the following signature:

A9AC43ECEE622060E31F3453224F4BB8AF735CF58224CACCF2A54A389907098D6BF3939BF052493C635F7DD42196DED2DB3A29D5855E4C27BE0D6F0B705B5806

I noticed that in the STM32 CryptoLibrary documentation, the private key is a 64 byte key.

I already tried to pad the the private key to 64 bytes, but the signature is still unequal to the CryptoPP signature.

Has anyone worked with this signature function and can help me out?

Did I oversee something?

0 REPLIES 0