> Currently there are three instances of ASN methods > and pmethods structures, because there three > different OIDs related to GOST public keys > (-2001, -2012, 256 bit, -2012 512 bit). > > I think I can merge all of them. However I need > to store an additional NID (digest NID, which > is a part of public key parameters) together > with a _KEY instance. I see two possibilities. > First is to add a digest_nid field to EC_KEY > structure. Second is to add a > typedef struct { > EC_KEY *ec; > int digest_nid; > } GOST_KEY; > > First way is a bit hackish. Second is clean but clumsy. > > What would you prefer?
The second way will lead us to subtle bugs with code allocating an EC_KEY and other code expecting the pointer to be a GOST_KEY. I see nothing wrong with an extra field within struct ec_key_st, and a libcrypto major bump due to the ABI change. Miod