Mbed-TLS / mbedtls

An open source, portable, easy to use, readable and flexible TLS library, and reference implementation of the PSA Cryptography API. Releases are on a varying cadence, typically around 3 - 6 months between releases.

Home Page:https://www.trustedfirmware.org/projects/mbed-tls/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Public Key Error for ED25519 Algorithm

sschneideribs opened this issue · comments

Greetings,

I am using following code snippet with the latest version(3.6.0) which unfortunately fails:

static char public_master_key[]{
    "-----BEGIN PUBLIC KEY-----\n"
    "MCowBQYDK2VwAyEA7l7Hc2FVEoncL7Go2EfigPkKzEmhBM76ed3RfgYSqXw=\n"
    "-----END PUBLIC KEY-----\n"};
bool verify(void){
mbedtls_pk_context context;
  mbedtls_pk_init(&context);
  auto ret = mbedtls_pk_parse_public_key(
      &context, reinterpret_cast<const unsigned char *>(public_master_key),
      std::strlen(public_master_key) + 1);
  if (ret != 0) {
    return false;
  }
//.....
}

I am getting the return error "MBEDTLS_ERR_PK_UNKNOWN_PK_ALG" even though the Public Key should be valid. Are there any known issues with using ED25519?