Cleanly puts all COSE_Key constants from the COSE registry into its own module
Cleanly implements the COSE_Key decoding in its own module
Fixes RSA keys having wrong key sizes. Previously the RSA key size was derived from the hash algorithm.
E.g. since SHA-256 has a size of 256, this is the size of the RSA key. But this only somewhat worked coincidentally, because the SHA-256 size is 256 bits, whereas RSA key size was passed as bytes, leading to a key size of 2048 bits, which just so happens to be the minimum key size you should have anyways.
Instead, the public key size can be directly derived from its serialized n parameter.
This allows removing a bunch of constants from the code
In addition, the tests now always use 2048 bit keys, which makes them run much faster, since previously they were generating RSA keys with 4096 bits (because SHA-512 has size 512 bits, which turned to 512 bytes key size = 4096 bits)
The number of conversion/helper functions was reduced to a minimum and mostly total ones
Slightly improves COSE_Key conformance by making sure that leading zero-octets in ECDSA keys are preserved
Does a cleanup of public key handling, notably:
n
parameter.