signature=19ac1583be281725178ac20796fa27d4,cryptography - STM32 Crypto Library - Wrong ED25519 Signa...

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.

The 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 the same 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?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值