1 year, 1 month ago.

mbedtls_pk_parse_keyfile with OpenSSL secp112r2

Hello,

In my current application, I was calling mbedtls_pk_parse_keyfile with a 192 bit key generated with OpenSSL using the secp192k1 curve.

I hit a problem which leads to requiring a smaller signature size, so to the best of my knowledge it seemed that the best way to achieve this was to use a smaller key size.

I then decided to try to load a 112 bit key generated with OpenSSL using secp112r2, which led to mbedtls_pk_parse_keyfile to return an error because it failed to parse such key.

I tried different sizes of keys and it seems that everything smaller than 192 lead to the same problem.

I vaguely remember that there was a limit to how small the key can be but I might be wrong.

Is there a way to get mbedtls to parse keys this small? and if not, is there a different API that could lead to a smaller size?

Thanks!

Be the first to answer this question.