pub enum IndexedSigCode {
Show 16 variants
Ed25519,
Ed25519Crt,
ECDSA256k1,
ECDSA256k1Crt,
ECDSA256r1,
ECDSA256r1Crt,
Ed448,
Ed448Crt,
Ed25519Big,
Ed25519BigCrt,
ECDSA256k1Big,
ECDSA256k1BigCrt,
ECDSA256r1Big,
ECDSA256r1BigCrt,
Ed448Big,
Ed448BigCrt,
}core only.Expand description
The 16 CESR indexed signature codes.
Each variant maps to a fixed CESR hard code string, a sizage table entry, and metadata about its index mode, raw size, and capacity.
“Crt” (current-only) variants carry only the signer’s index in the current key list. Non-Crt variants carry both a current index and a prior-next “ondex”.
“Big” variants use a wider soft field and support larger index values than their small counterparts.
Variants§
Ed25519
Ed25519 indexed signature — "A"
Ed25519Crt
Ed25519 current-only indexed signature — "B"
ECDSA256k1
ECDSA secp256k1 indexed signature — "C"
ECDSA256k1Crt
ECDSA secp256k1 current-only indexed signature — "D"
ECDSA256r1
ECDSA P-256 indexed signature — "E"
ECDSA256r1Crt
ECDSA P-256 current-only indexed signature — "F"
Ed448
Ed448 indexed signature — "0A"
Ed448Crt
Ed448 current-only indexed signature — "0B"
Ed25519Big
Ed25519 big indexed signature — "2A"
Ed25519BigCrt
Ed25519 big current-only indexed signature — "2B"
ECDSA256k1Big
ECDSA secp256k1 big indexed signature — "2C"
ECDSA256k1BigCrt
ECDSA secp256k1 big current-only indexed signature — "2D"
ECDSA256r1Big
ECDSA P-256 big indexed signature — "2E"
ECDSA256r1BigCrt
ECDSA P-256 big current-only indexed signature — "2F"
Ed448Big
Ed448 big indexed signature — "3A"
Ed448BigCrt
Ed448 big current-only indexed signature — "3B"
Implementations§
Source§impl IndexedSigCode
impl IndexedSigCode
Sourcepub fn frame_size(stream: &[u8]) -> Result<usize, IndexerParseError>
pub fn frame_size(stream: &[u8]) -> Result<usize, IndexerParseError>
Full qb64 character size of the indexed primitive at the head of stream,
without decoding raw bytes.
§Errors
IndexerParseError on unknown code, short stream, bad UTF-8, or size overflow.
Source§impl IndexedSigCode
impl IndexedSigCode
Sourcepub fn from_hard(hard: &str) -> Result<Self, CodeError>
pub fn from_hard(hard: &str) -> Result<Self, CodeError>
Parses a hard code string back to the corresponding enum variant.
§Errors
Returns CodeError::UnknownCode if hard does not match any known
indexed signature code.
Sourcepub const fn get_xizage(&self) -> Xizage
pub const fn get_xizage(&self) -> Xizage
Returns the Xizage sizage entry for this code (from the cesride
reference table).
Sourcepub const fn mode(&self) -> IndexMode
pub const fn mode(&self) -> IndexMode
Returns the IndexMode for this code.
Both variants carry a current index and a prior-next “ondex”.
CurrentOnly variants carry only the current index.
Sourcepub const fn is_big(&self) -> bool
pub const fn is_big(&self) -> bool
Returns true if this is a “big” variant with a wider index field.
Sourcepub const fn raw_size(&self) -> usize
pub const fn raw_size(&self) -> usize
Returns the raw signature size in bytes.
Ed25519 and ECDSA (256-bit) signatures are 64 bytes. Ed448 signatures are 114 bytes. The size is the same regardless of small vs. big variants.
Sourcepub const fn max_index(&self) -> u32
pub const fn max_index(&self) -> u32
Returns the maximum index value this code can encode.
Formula: 64^(ss - os) - 1 where ss is the soft size and os is the
ondex size from the sizage table.
Trait Implementations§
Source§impl Clone for IndexedSigCode
impl Clone for IndexedSigCode
Source§fn clone(&self) -> IndexedSigCode
fn clone(&self) -> IndexedSigCode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more