pub struct BitStringFmt<const DER: bool = true>;Expand description
ASN.1 BIT STRING contents format.
When DER = true (the default), only the canonical DER form is accepted, which requires
the trailing unused bits to be zero.
When DER = false, the parser allows any value for the trailing unused bits.
Trait Implementations§
Source§impl ByteLen<BitStringOwned> for BitStringFmt<false>
Available on crate feature alloc only.
impl ByteLen<BitStringOwned> for BitStringFmt<false>
Available on crate feature
alloc only.Source§impl<const DER: bool> Clone for BitStringFmt<DER>
impl<const DER: bool> Clone for BitStringFmt<DER>
Source§fn clone(&self) -> BitStringFmt<DER>
fn clone(&self) -> BitStringFmt<DER>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<const DER: bool> Consistency for BitStringFmt<DER>
impl<const DER: bool> Consistency for BitStringFmt<DER>
Source§open(super) spec fn consistent(&self, v: Self::Val) -> bool
open(super) spec fn consistent(&self, v: Self::Val) -> bool
Source§type Val = BitStringSpec
type Val = BitStringSpec
The type of values whose consistency is being checked.
Source§impl<'a> DerOrd<BitString<'a>> for BitStringFmt<true>
impl<'a> DerOrd<BitString<'a>> for BitStringFmt<true>
Source§proof fn lemma_der_serialize_len(&self, value: BitStringSpec)
proof fn lemma_der_serialize_len(&self, value: BitStringSpec)
Source§open spec fn der_remaining(
&self,
value: BitStringSpec,
state: PairDerState<bool, BytesDerState>,
) -> Seq<u8>
open spec fn der_remaining( &self, value: BitStringSpec, state: PairDerState<bool, BytesDerState>, ) -> Seq<u8>
{
<Pair<
U8,
Tail,
> as DerOrd<
(u8, &'a [u8]),
>>::der_remaining(&Pair(U8, Tail), (value.unused, value.bits), state)
}Source§open spec fn der_state_valid(
&self,
value: BitStringSpec,
state: PairDerState<bool, BytesDerState>,
) -> bool
open spec fn der_state_valid( &self, value: BitStringSpec, state: PairDerState<bool, BytesDerState>, ) -> bool
{
<Pair<
U8,
Tail,
> as DerOrd<
(u8, &'a [u8]),
>>::der_state_valid(&Pair(U8, Tail), (value.unused, value.bits), state)
}Source§exec fn der_start(
&self,
b: &BitString<'a, true>,
) -> state : PairDerState<bool, BytesDerState>
exec fn der_start( &self, b: &BitString<'a, true>, ) -> state : PairDerState<bool, BytesDerState>
Source§exec fn der_next(
&self,
b: &BitString<'a, true>,
state: &mut PairDerState<bool, BytesDerState>,
) -> next : Option<u8>
exec fn der_next( &self, b: &BitString<'a, true>, state: &mut PairDerState<bool, BytesDerState>, ) -> next : Option<u8>
Source§impl DerState for BitStringFmt<true>
impl DerState for BitStringFmt<true>
type State = PairDerState<bool, BytesDerState>
Source§impl<const DER: bool> EquivSerializers for BitStringFmt<DER>
impl<const DER: bool> EquivSerializers for BitStringFmt<DER>
Source§impl<const DER: bool> GoodSerializer for BitStringFmt<DER>
impl<const DER: bool> GoodSerializer for BitStringFmt<DER>
Source§proof fn lemma_serialize_len(&self, v: Self::SVal)
proof fn lemma_serialize_len(&self, v: Self::SVal)
Source§fn serialize_inv(&self) -> bool
fn serialize_inv(&self) -> bool
Source§impl<const DER: bool> NonMalleable for BitStringFmt<DER>
impl<const DER: bool> NonMalleable for BitStringFmt<DER>
Source§proof fn lemma_parse_non_malleable(&self, buf1: Seq<u8>, buf2: Seq<u8>)
proof fn lemma_parse_non_malleable(&self, buf1: Seq<u8>, buf2: Seq<u8>)
Source§fn nonmal_inv(&self) -> bool
fn nonmal_inv(&self) -> bool
Source§impl Prepare<BitStringOwned> for BitStringFmt<false>
Available on crate feature alloc only.
impl Prepare<BitStringOwned> for BitStringFmt<false>
Available on crate feature
alloc only.Source§impl<const DER: bool> Productive for BitStringFmt<DER>
impl<const DER: bool> Productive for BitStringFmt<DER>
Source§proof fn lemma_productive(&self, s: Seq<u8>)
proof fn lemma_productive(&self, s: Seq<u8>)
Source§fn productive_inv(&self) -> bool
fn productive_inv(&self) -> bool
Source§impl<const DER: bool> SPRoundTripDps for BitStringFmt<DER>
impl<const DER: bool> SPRoundTripDps for BitStringFmt<DER>
Source§proof fn theorem_serialize_dps_parse_roundtrip(&self, v: Self::T, obuf: Seq<u8>)
proof fn theorem_serialize_dps_parse_roundtrip(&self, v: Self::T, obuf: Seq<u8>)
Source§fn unambiguous(&self) -> bool
fn unambiguous(&self) -> bool
Source§impl<const DER: bool> SafeParser for BitStringFmt<DER>
impl<const DER: bool> SafeParser for BitStringFmt<DER>
Source§impl<'i, Output: OutputBuf, const DER: bool> Serializer<Output, BitString<'i, DER>> for BitStringFmt<DER>
impl<'i, Output: OutputBuf, const DER: bool> Serializer<Output, BitString<'i, DER>> for BitStringFmt<DER>
Source§exec fn serialize_into(&self, v: &BitString<'i, DER>, obuf: &mut Output)
exec fn serialize_into(&self, v: &BitString<'i, DER>, obuf: &mut Output)
Source§impl<Output: OutputBuf> Serializer<Output, BitStringOwned> for BitStringFmt<false>
Available on crate feature alloc only.
impl<Output: OutputBuf> Serializer<Output, BitStringOwned> for BitStringFmt<false>
Available on crate feature
alloc only.Source§exec fn serialize_into(&self, v: &BitStringOwned, obuf: &mut Output)
exec fn serialize_into(&self, v: &BitStringOwned, obuf: &mut Output)
Source§impl<const DER: bool> SoundParser for BitStringFmt<DER>
impl<const DER: bool> SoundParser for BitStringFmt<DER>
Source§impl<const DER: bool> SpecByteLen for BitStringFmt<DER>
impl<const DER: bool> SpecByteLen for BitStringFmt<DER>
Source§impl<const DER: bool> SpecParser for BitStringFmt<DER>
impl<const DER: bool> SpecParser for BitStringFmt<DER>
Source§type PVal = BitStringSpec
type PVal = BitStringSpec
The type of parsed values.
Source§impl<const DER: bool> SpecSerializer for BitStringFmt<DER>
impl<const DER: bool> SpecSerializer for BitStringFmt<DER>
Source§open(super) spec fn spec_serialize(&self, v: Self::SVal) -> Seq<u8>
open(super) spec fn spec_serialize(&self, v: Self::SVal) -> Seq<u8>
Source§type SVal = BitStringSpec
type SVal = BitStringSpec
The type of values to be serialized.
Source§impl<const DER: bool> SpecSerializerDps for BitStringFmt<DER>
impl<const DER: bool> SpecSerializerDps for BitStringFmt<DER>
Source§type SValue = BitStringSpec
type SValue = BitStringSpec
The type of values to be serialized.
impl<const DER: bool> Copy for BitStringFmt<DER>
Auto Trait Implementations§
impl<const DER: bool> Freeze for BitStringFmt<DER>
impl<const DER: bool> RefUnwindSafe for BitStringFmt<DER>
impl<const DER: bool> Send for BitStringFmt<DER>
impl<const DER: bool> Sync for BitStringFmt<DER>
impl<const DER: bool> Unpin for BitStringFmt<DER>
impl<const DER: bool> UnsafeUnpin for BitStringFmt<DER>
impl<const DER: bool> UnwindSafe for BitStringFmt<DER>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, VERUS_SPEC__A> FromSpec<T> for VERUS_SPEC__Awhere
VERUS_SPEC__A: From<T>,
impl<T, VERUS_SPEC__A> FromSpec<T> for VERUS_SPEC__Awhere
VERUS_SPEC__A: From<T>,
fn obeys_from_spec() -> bool
fn from_spec(v: T) -> VERUS_SPEC__A
§impl<T, VERUS_SPEC__A> IntoSpec<T> for VERUS_SPEC__Awhere
VERUS_SPEC__A: Into<T>,
impl<T, VERUS_SPEC__A> IntoSpec<T> for VERUS_SPEC__Awhere
VERUS_SPEC__A: Into<T>,
fn obeys_into_spec() -> bool
fn into_spec(self) -> T
§impl<T, U> IntoSpecImpl<U> for Twhere
U: From<T>,
impl<T, U> IntoSpecImpl<U> for Twhere
U: From<T>,
fn obeys_into_spec() -> bool
fn into_spec(self) -> U
Source§impl<C> NonAmbiguous for Cwhere
C: SPRoundTrip,
impl<C> NonAmbiguous for Cwhere
C: SPRoundTrip,
Source§open spec fn nonamb_inv(&self) -> bool
open spec fn nonamb_inv(&self) -> bool
{ self.sp_roundtrip_inv() }Source§proof fn lemma_serialize_injective(
&self,
v1: <C as Consistency>::Val,
v2: <C as Consistency>::Val,
)
proof fn lemma_serialize_injective( &self, v1: <C as Consistency>::Val, v2: <C as Consistency>::Val, )
Source§impl<C> PSRoundTrip for C
impl<C> PSRoundTrip for C
Source§open spec fn ps_roundtrip_inv(&self) -> bool
open spec fn ps_roundtrip_inv(&self) -> bool
{ self.safe_inv() && self.sound_inv() && self.nonmal_inv() && self.sp_roundtrip_inv() }Source§proof fn theorem_parse_serialize_roundtrip(&self, ibuf: Seq<u8>)
proof fn theorem_parse_serialize_roundtrip(&self, ibuf: Seq<u8>)
Source§impl<C> SPRoundTrip for C
impl<C> SPRoundTrip for C
Source§open spec fn sp_roundtrip_inv(&self) -> bool
open spec fn sp_roundtrip_inv(&self) -> bool
{ self.serialize_inv() && self.equiv_inv() && self.unambiguous() }