Skip to content

Conversation

tarcieri
Copy link
Member

@tarcieri tarcieri commented Jun 3, 2021

Adds a TagNumber type for representing the lower 5 bits of a Tag, where bits 8/7 identify the class and bit 6 identifies primitive vs constructed forms.

Changes Tag from being repr(u8) to a structured representation with Application, ContextSpecific, and Private variants, each of which includes a TagNumber. This enables support for all of these classes for tag numbers up to 30, which is the maximum value which can be represented with a single leading identifier octet.

This change enables the ContextSpecific struct to have public members, as the tag number invariant can now be maintained by the TagNumber type instead.

Adds a `TagNumber` type for representing the lower 5 bits of a Tag,
where bits 8/7 identify the class and bit 6 identifies primitive vs
constructed forms.

Changes `Tag` from being `repr(u8)` to a structured representation with
`Application`, `ContextSpecific`, and `Private` variants, each of which
includes a `TagNumber`. This enables support for all of these classes
for tag numbers up to 30, which is the maximum value which can be
represented with a single leading identifier octet.

This change enables the `ContextSpecific` struct to have public members,
as the tag number invariant can now be maintained by the `TagNumber`
type instead.
@tarcieri tarcieri force-pushed the der/structured-tags-and-tag-numbers branch from 403be1a to 5a50995 Compare June 3, 2021 17:52
@tarcieri tarcieri merged commit 863f59d into master Jun 3, 2021
@tarcieri tarcieri deleted the der/structured-tags-and-tag-numbers branch June 3, 2021 17:55
@tarcieri tarcieri mentioned this pull request Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant