Skip to content

No ability to introspect encryption algorithm IV and tag length #122

@BrianSipos

Description

@BrianSipos

The encryption algorithms registered in RFC 9053 have fixed IV lengths defined for specific code points. From the current pycose.algorithms interfaces I don't think there is a way to introspect the algorithm objects to determine the correct IV lengths.

For example, with the hash algorithms I can inspect algo.hash_cls.digest_size to determine the hash output size in bytes.
It would be convenient if pycose.algorithms._EncAlg included an abstract interface to get IV length and derived classes like _AesGcm could define the specific length for registered algorithms.

Similar to this, it would be helpful if the base _EncAlg class defined the interface get_tag_length() so that a user could introspect and determine how much longer the AEAD ciphertext will be compared to the plaintext.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions