QSC Post Quantum Cryptographic Library 1.0.0.6c (A6)
A post quantum secure library written in Ansi C
 
Loading...
Searching...
No Matches
qsc_encoding_ber_element Struct Reference

Represents a BER (Basic Encoding Rules) element. More...

#include <encoding.h>

Data Fields

uint8_t tagclass
 
bool constructed
 
uint32_t tagnumber
 
bool indefinite
 
size_t length
 
uint8_t * value
 
struct qsc_encoding_ber_element ** children
 
size_t ccount
 

Detailed Description

Represents a BER (Basic Encoding Rules) element.

This structure is used to represent an ASN.1 element encoded using BER. An element may be either:

  • Primitive: where the value is encoded directly in the value buffer.
  • Constructed: where the element contains child BER elements. For constructed types, either the pre-encoded block is stored in value (definite-length encoding) or the individual child elements are stored in the children array.

The structure holds the tag class, the constructed flag, and the tag number. For primitive elements, value and length are used to represent the element's data. For constructed elements, the children pointer is used (typically during decoding), although in some cases the pre-encoded block is placed in value along with its length.

Field Documentation

◆ ccount

size_t ccount

The number of child elements pointed to by the children array.

◆ children

struct qsc_encoding_ber_element** children

Array of pointers to child qsc_encoding_ber_element structures (used for constructed types when decoding into individual child elements).

◆ constructed

bool constructed

Flag indicating if the element is constructed (true) or primitive (false).

◆ indefinite

bool indefinite

true if the element's length was encoded in the indefinite form, false if definite.

◆ length

size_t length

For definite-length encoding, the number of bytes in the value or in the pre-encoded block of child elements.

◆ tagclass

uint8_t tagclass

Tag class (e.g., QSC_ENCODING_BER_CLASS_UNIVERSAL, BER_CLASS_APPLICATION, QSC_ENCODING_BER_CLASS_CONTEXT_SPECIFIC, or QSC_ENCODING_BER_CLASS_PRIVATE).

◆ tagnumber

uint32_t tagnumber

Tag number; may be greater than 30, which requires long-form encoding.

◆ value

uint8_t* value

Pointer to the element's raw value bytes. For primitive types, this holds the encoded data. For definite constructed types, it may hold a pre-encoded block.


The documentation for this struct was generated from the following file: