EVP_PKEY_get_int_param is not getting degree from EC key

Jakob Bohm jb-openssl at wisemo.com
Wed Jan 5 13:26:50 UTC 2022


On 2022-01-05 09:45, Tomas Mraz wrote:

> ...
> So you're basically asking to put something like - "The parameter most
> probably won't fit into unsigned int." - to every such parameter
> documented for PKEYs?
>
"unsigned BIGNUM" instead of "unsigned integer" would be short and much 
clearer
in the description and naming of parameters unlikely to fit in a C int/long.

Also to me "the degree of an EC curve" refers to the form of the curve 
equation,
not the bit length of the point coordinates, for example, the P-384 
curve uses a
degree 3 equation, and modulo prime p and curve order n both being 384-bit
bignums.

What many API users probably want is a quick way to get the nominal bit 
length
of a public key or group, as a proxy for the cryptographic strength and 
as a rough
guide to allocating data buffers.  This API should not give access to or 
reveal the
exact group parameters or public key, that would be different (but still 
needed)
APIs/parameters.  For example, it would return 4096 for RSA4096, 384 for 
the
NIST P-384 curve etc.

Enjoy,

Jakob Bohm

Enjoy

Jakob
-- 
Jakob Bohm, CIO, Partner, WiseMo A/S.  https://www.wisemo.com
Transformervej 29, 2860 Søborg, Denmark.  Direct +45 31 13 16 10
This public discussion message is non-binding and may contain errors.
WiseMo - Remote Service Management for PCs, Phones and Embedded



More information about the openssl-users mailing list