#![allow(non_upper_case_globals)]
pub mod any;
pub mod ber;
pub mod bitstring;
pub mod bmpstring;
pub mod boolean;
pub mod constraints;
pub mod datetime;
pub mod der;
pub mod der_ord;
pub mod disjoint;
pub mod enumerated;
pub mod generalizedtime;
pub mod ia5string;
pub mod integer;
pub mod length;
pub mod macros;
pub mod modifiers;
pub mod numericstring;
pub mod oid;
pub mod printablestring;
pub mod real;
pub mod set_of;
pub mod tag;
pub mod teletexstring;
pub mod tlv;
pub mod universalstring;
pub mod utctime;
pub mod utf8string;
#[cfg(feature = "alloc")]
pub use any::AnyOwned;
pub use any::{Any, AnySpec};
pub use ber::{
BerAnyFmt, BerBitStringFmt, BerBmpStringFmt, BerCharStringFmt, BerIa5StringFmt,
BerOctetStringFmt, BerPrintableStringFmt, BerSequenceFmt, BerSequenceOfFmt,
BerTeletexStringFmt, BerUtf8StringFmt, EocFmt, EOC,
};
#[cfg(feature = "alloc")]
pub use bitstring::BitStringOwned;
pub use bitstring::{BitString, BitStringSpec};
#[cfg(feature = "alloc")]
pub use bmpstring::BmpString;
pub use bmpstring::BmpStringSpec;
pub use constraints::{ConstraintAnd, ConstraintNot, ConstraintOr, IntegerRange, Size};
pub use datetime::{DateTime, TimePrecision, TimeZone};
pub use der::*;
pub use der_ord::{DeepViewIdentity, DerOrd};
pub use enumerated::Enumerated;
pub use generalizedtime::{GeneralizedTime, GeneralizedTimeSpec};
#[cfg(feature = "alloc")]
pub use ia5string::Ia5StringOwned;
pub use ia5string::{Ia5String, Ia5StringSpec};
pub use integer::{Integer, Integer16Fmt, Integer8Fmt};
pub use modifiers::{DefaultedFmt, ImplicitlyTaggedFmt, Retaggable};
#[cfg(feature = "alloc")]
pub use numericstring::NumericStringOwned;
pub use numericstring::{NumericString, NumericStringFmt, NumericStringSpec};
#[cfg(feature = "alloc")]
pub use oid::ObjectIdentifier;
pub use oid::ObjectIdentifierSpec;
#[cfg(feature = "alloc")]
pub use printablestring::PrintableStringOwned;
pub use printablestring::{PrintableString, PrintableStringSpec};
pub use real::{Real, RealSpec};
pub use set_of::SetOfFmt;
pub use tag::{constructed_tag, primitive_tag, Class, Tag};
#[cfg(feature = "alloc")]
pub use teletexstring::TeletexStringOwned;
pub use teletexstring::{TeletexString, TeletexStringSpec};
#[cfg(feature = "alloc")]
pub use universalstring::UniversalString;
pub use universalstring::UniversalStringSpec;
pub use utctime::UtcTime;
pub use utf8string::Utf8String;
#[cfg(feature = "alloc")]
pub use utf8string::Utf8StringOwned;
use crate::{
combinators::{
implicit::NBytesOf, mapped::spec::FnSpecMapper, Const, Empty, PrefixTagged, Tail, TryMap,
U8,
},
core::proof::{Leaf, LeafNonMalleable},
};
use vstd::prelude::*;
verus! {
pub const DER: bool = true;
pub const BER: bool = false;
#[derive(Copy)]
pub struct ASN1Fmt<Content, const DER: bool = true>(pub Tag, pub Content);
impl<Content: Clone, const DER: bool> Clone for ASN1Fmt<Content, DER> {
fn clone(&self) -> (cloned: Self)
ensures
call_ensures(Content::clone, (&self.1,), cloned.1),
{
ASN1Fmt(self.0, self.1.clone())
}
}
#[derive(Clone, Copy)]
pub struct BoolFmt<const DER: bool = true>;
pub type BerBoolFmt = BoolFmt<false>;
pub type DerBoolFmt = BoolFmt<true>;
pub const BerBoolFmt: BoolFmt<false> = BoolFmt;
pub const DerBoolFmt: BoolFmt<true> = BoolFmt;
#[derive(Clone, Copy)]
pub struct AnyFmt<const DER: bool = true>;
pub type BerDefiniteAnyFmt = AnyFmt<false>;
pub type DerAnyFmt = AnyFmt<true>;
pub const BerDefiniteAnyFmt: BerDefiniteAnyFmt = AnyFmt;
pub const DerAnyFmt: DerAnyFmt = AnyFmt;
#[derive(Clone, Copy)]
pub struct NatLengthFmt<const DER: bool = true>;
#[derive(Clone, Copy)]
pub struct LengthFmt<const DER: bool = true>;
#[derive(StructuralEq, Copy, Clone, PartialEq, Eq, Debug)]
pub enum BerLength {
Definite(usize),
Indefinite,
}
impl DeepView for BerLength {
type V = Self;
open spec fn deep_view(&self) -> Self::V {
*self
}
}
#[derive(Clone, Copy)]
pub struct BerLengthFmt;
#[derive(Clone, Copy)]
pub struct IntegerFmt;
#[derive(Clone, Copy)]
pub struct EnumeratedFmt;
#[derive(Clone, Copy)]
pub struct ObjectIdentifierFmt;
#[derive(Clone, Copy)]
pub struct RealFmt<const DER: bool = true>;
#[derive(Clone, Copy)]
pub struct BitStringFmt<const DER: bool = true>;
pub type BerBitStringContentFmt = BitStringFmt<false>;
#[derive(Clone, Copy)]
pub struct TagFmt;
pub type DerBitStringFmt = BitStringFmt<true>;
pub type OctetStringFmt = Tail;
pub const OctetStringFmt: Tail = Tail;
pub type NullFmt = Empty;
pub const NullFmt: Empty = Empty;
#[derive(Clone, Copy)]
pub struct UtcTimeFmt<const DER: bool = true>;
pub type BerUtcTimeFmt = UtcTimeFmt<false>;
pub type DerUtcTimeFmt = UtcTimeFmt<true>;
pub const BerUtcTimeFmt: BerUtcTimeFmt = UtcTimeFmt;
pub const DerUtcTimeFmt: DerUtcTimeFmt = UtcTimeFmt;
#[derive(Clone, Copy)]
pub struct Utf8StringFmt;
#[derive(Clone, Copy)]
pub struct PrintableStringFmt;
#[derive(Clone, Copy)]
pub struct Ia5StringFmt;
#[derive(Clone, Copy)]
pub struct BmpStringFmt;
#[derive(Clone, Copy)]
pub struct TeletexStringFmt;
#[derive(Clone, Copy)]
pub struct UniversalStringFmt;
#[derive(Clone, Copy)]
pub struct GeneralizedTimeFmt<const DER: bool = true>;
pub type BerGeneralizedTimeFmt = GeneralizedTimeFmt<false>;
pub type DerGeneralizedTimeFmt = GeneralizedTimeFmt<true>;
pub const BerGeneralizedTimeFmt: BerGeneralizedTimeFmt = GeneralizedTimeFmt;
pub const DerGeneralizedTimeFmt: DerGeneralizedTimeFmt = GeneralizedTimeFmt;
impl LeafNonMalleable for DerBoolFmt {
proof fn nonmal_leaf_inv(&self) {
}
}
impl Leaf for BerBoolFmt {
proof fn leaf_inv(&self) {
}
}
}