# Generated by cstruct-stubgen
from typing import BinaryIO, Literal, TypeAlias, overload

import dissect.cstruct as __cs__

class _c_bde(__cs__.cstruct):
    class _FVE_GUID_RECOGNITION(__cs__.Structure):
        Guid: __cs__.CharArray
        InformationOffset: __cs__.Array[_c_bde.uint64]
        @overload
        def __init__(
            self, Guid: __cs__.CharArray | None = ..., InformationOffset: __cs__.Array[_c_bde.uint64] | None = ...
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_GUID_RECOGNITION: TypeAlias = _FVE_GUID_RECOGNITION
    class _FVE_EOW_GUID_RECOGNITION(__cs__.Structure):
        Guid: __cs__.CharArray
        InformationOffset: __cs__.Array[_c_bde.uint64]
        EowOffset: __cs__.Array[_c_bde.uint64]
        @overload
        def __init__(
            self,
            Guid: __cs__.CharArray | None = ...,
            InformationOffset: __cs__.Array[_c_bde.uint64] | None = ...,
            EowOffset: __cs__.Array[_c_bde.uint64] | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_EOW_GUID_RECOGNITION: TypeAlias = _FVE_EOW_GUID_RECOGNITION
    class _BIOS_PARAMETER_BLOCK(__cs__.Structure):
        BytesPerSector: _c_bde.uint16
        SectorsPerCluster: _c_bde.uint8
        ReservedSectors: _c_bde.uint16
        Fats: _c_bde.uint8
        RootEntries: _c_bde.uint16
        Sectors: _c_bde.uint16
        Media: _c_bde.uint8
        SectorsPerFat: _c_bde.uint16
        SectorsPerTrack: _c_bde.uint16
        Heads: _c_bde.uint16
        HiddenSectors: _c_bde.uint32
        LargeSectors: _c_bde.uint32
        @overload
        def __init__(
            self,
            BytesPerSector: _c_bde.uint16 | None = ...,
            SectorsPerCluster: _c_bde.uint8 | None = ...,
            ReservedSectors: _c_bde.uint16 | None = ...,
            Fats: _c_bde.uint8 | None = ...,
            RootEntries: _c_bde.uint16 | None = ...,
            Sectors: _c_bde.uint16 | None = ...,
            Media: _c_bde.uint8 | None = ...,
            SectorsPerFat: _c_bde.uint16 | None = ...,
            SectorsPerTrack: _c_bde.uint16 | None = ...,
            Heads: _c_bde.uint16 | None = ...,
            HiddenSectors: _c_bde.uint32 | None = ...,
            LargeSectors: _c_bde.uint32 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    BIOS_PARAMETER_BLOCK: TypeAlias = _BIOS_PARAMETER_BLOCK
    class _BOOT_SECTOR(__cs__.Structure):
        Jump: __cs__.CharArray
        Oem: __cs__.CharArray
        Bpb: _c_bde._BIOS_PARAMETER_BLOCK
        Unused0: __cs__.CharArray
        InformationLcn: _c_bde.uint64
        Mft2StartLcn: _c_bde.uint64
        Unused1: __cs__.CharArray
        PartitionLength: _c_bde.uint64
        Unused2: __cs__.CharArray
        BytesPerSectorShift: _c_bde.uint8
        SectorsPerClusterShift: _c_bde.uint8
        Unused3: __cs__.CharArray
        @overload
        def __init__(
            self,
            Jump: __cs__.CharArray | None = ...,
            Oem: __cs__.CharArray | None = ...,
            Bpb: _c_bde._BIOS_PARAMETER_BLOCK | None = ...,
            Unused0: __cs__.CharArray | None = ...,
            InformationLcn: _c_bde.uint64 | None = ...,
            Mft2StartLcn: _c_bde.uint64 | None = ...,
            Unused1: __cs__.CharArray | None = ...,
            PartitionLength: _c_bde.uint64 | None = ...,
            Unused2: __cs__.CharArray | None = ...,
            BytesPerSectorShift: _c_bde.uint8 | None = ...,
            SectorsPerClusterShift: _c_bde.uint8 | None = ...,
            Unused3: __cs__.CharArray | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    BOOT_SECTOR: TypeAlias = _BOOT_SECTOR
    class FVE_STATE(__cs__.Enum):
        DECRYPTED = ...
        SWITCHING_DIRTY = ...
        PAUSED = ...
        ENCRYPTED = ...
        SWITCHING = ...

    class FVE_KEY_TYPE(__cs__.Enum):
        NONE = ...
        EXTERNAL = ...
        STRETCH_KEY = ...
        STRETCH_KEY_1 = ...
        AES_CCM_256_0 = ...
        AES_CCM_256_1 = ...
        EXTERN_KEY = ...
        VMK = ...
        AES_CCM_256_2 = ...
        HASH_256 = ...
        AES_128_DIFFUSER = ...
        AES_256_DIFFUSER = ...
        AES_128 = ...
        AES_256 = ...
        AES_XTS_128 = ...
        AES_XTS_256 = ...

    class FVE_KEY_PROTECTOR(__cs__.Flag):
        CLEAR = ...
        TPM = ...
        EXTERNAL = ...
        TPM_PIN = ...
        RECOVERY_PASSWORD = ...
        PASSPHRASE = ...

    class FVE_KEY_FLAG(__cs__.Flag):
        NONE = ...
        ENHANCED_PIN = ...
        ENHANCED_CRYPTO = ...
        PBKDF2 = ...

    class FVE_DATUM_ROLE(__cs__.Enum):
        PROPERTY = ...
        UNKNOWN_1 = ...
        VOLUME_MASTER_KEY_INFO = ...
        FULL_VOLUME_ENCRYPTION_KEY = ...
        VALIDATION = ...
        UNKNOWN_5 = ...
        STARTUP_KEY = ...
        DESCRIPTION = ...
        UNKNOWN_8 = ...
        UNKNOWN_9 = ...
        UNKNOWN_A = ...
        AUTO_UNLOCK = ...
        FULL_VOLUME_ENCRYPTION_KEY_2 = ...
        UNKNOWN_D = ...
        UNKNOWN_E = ...
        VIRTUALIZATION_INFO = ...
        VALIDATION_HASH = ...

    class FVE_DATUM_TYPE(__cs__.Enum):
        ERASED = ...
        KEY = ...
        UNICODE = ...
        STRETCH_KEY = ...
        USE_KEY = ...
        AES_CCM_ENCRYPTED_KEY = ...
        TPM_ENCRYPTED_BLOB = ...
        VALIDATION_INFO = ...
        VOLUME_MASTER_KEY_INFO = ...
        EXTERNAL_INFO = ...
        UPDATE = ...
        ERROR_LOG = ...
        ASYMMETRIC_ENCRYPTED_KEY = ...
        EXPORTED_KEY = ...
        PUBLIC_KEY_INFO = ...
        VIRTUALIZATION_INFO = ...
        SIMPLE_1 = ...
        SIMPLE_2 = ...
        CONCAT_HASH_KEY = ...
        SIMPLE_3 = ...
        SIMPLE_LARGE = ...
        BACKUP_INFO = ...

    class _FVE_INFORMATION(__cs__.Structure):
        Signature: __cs__.CharArray
        HeaderSize: _c_bde.uint16
        Version: _c_bde.uint16
        CurrentState: _c_bde.uint16
        NextState: _c_bde.uint16
        StateOffset: _c_bde.uint64
        StateSize: _c_bde.uint32
        VirtualizedSectors: _c_bde.uint32
        InformationOffset: __cs__.Array[_c_bde.uint64]
        Mft2StartLcn: _c_bde.uint64
        VirtualizedBlockOffset: _c_bde.uint64
        @overload
        def __init__(
            self,
            Signature: __cs__.CharArray | None = ...,
            HeaderSize: _c_bde.uint16 | None = ...,
            Version: _c_bde.uint16 | None = ...,
            CurrentState: _c_bde.uint16 | None = ...,
            NextState: _c_bde.uint16 | None = ...,
            StateOffset: _c_bde.uint64 | None = ...,
            StateSize: _c_bde.uint32 | None = ...,
            VirtualizedSectors: _c_bde.uint32 | None = ...,
            InformationOffset: __cs__.Array[_c_bde.uint64] | None = ...,
            Mft2StartLcn: _c_bde.uint64 | None = ...,
            VirtualizedBlockOffset: _c_bde.uint64 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_INFORMATION: TypeAlias = _FVE_INFORMATION
    class _FVE_DATASET(__cs__.Structure):
        Size: _c_bde.uint32
        Version: _c_bde.uint32
        StartOffset: _c_bde.uint32
        EndOffset: _c_bde.uint32
        Identification: __cs__.CharArray
        NonceCounter: _c_bde.uint32
        FvekType: _c_bde.uint16
        FvekPrefType: _c_bde.uint16
        CreationTime: _c_bde.uint64
        @overload
        def __init__(
            self,
            Size: _c_bde.uint32 | None = ...,
            Version: _c_bde.uint32 | None = ...,
            StartOffset: _c_bde.uint32 | None = ...,
            EndOffset: _c_bde.uint32 | None = ...,
            Identification: __cs__.CharArray | None = ...,
            NonceCounter: _c_bde.uint32 | None = ...,
            FvekType: _c_bde.uint16 | None = ...,
            FvekPrefType: _c_bde.uint16 | None = ...,
            CreationTime: _c_bde.uint64 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_DATASET: TypeAlias = _FVE_DATASET
    class _FVE_DATUM(__cs__.Structure):
        Size: _c_bde.uint16
        Role: _c_bde.uint16
        Type: _c_bde.uint16
        Flags: _c_bde.uint16
        @overload
        def __init__(
            self,
            Size: _c_bde.uint16 | None = ...,
            Role: _c_bde.uint16 | None = ...,
            Type: _c_bde.uint16 | None = ...,
            Flags: _c_bde.uint16 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_DATUM: TypeAlias = _FVE_DATUM
    class _FVE_VALIDATION(__cs__.Structure):
        Size: _c_bde.uint16
        Version: _c_bde.uint16
        Crc32: _c_bde.uint32
        @overload
        def __init__(
            self,
            Size: _c_bde.uint16 | None = ...,
            Version: _c_bde.uint16 | None = ...,
            Crc32: _c_bde.uint32 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_VALIDATION: TypeAlias = _FVE_VALIDATION
    class _FVE_DATUM_SIMPLE(__cs__.Structure):
        Data: _c_bde.uint32
        @overload
        def __init__(self, Data: _c_bde.uint32 | None = ...): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_DATUM_SIMPLE: TypeAlias = _FVE_DATUM_SIMPLE
    class _FVE_DATUM_SIMPLE_LARGE(__cs__.Structure):
        Data: _c_bde.uint64
        @overload
        def __init__(self, Data: _c_bde.uint64 | None = ...): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_DATUM_SIMPLE_LARGE: TypeAlias = _FVE_DATUM_SIMPLE_LARGE
    class _FVE_DATUM_GUID(__cs__.Structure):
        Guid: __cs__.CharArray
        @overload
        def __init__(self, Guid: __cs__.CharArray | None = ...): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_DATUM_GUID: TypeAlias = _FVE_DATUM_GUID
    class _FVE_DATUM_KEY(__cs__.Structure):
        KeyType: _c_bde.uint16
        KeyFlags: _c_bde.uint16
        @overload
        def __init__(self, KeyType: _c_bde.uint16 | None = ..., KeyFlags: _c_bde.uint16 | None = ...): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_DATUM_KEY: TypeAlias = _FVE_DATUM_KEY
    class _FVE_DATUM_UNICODE(__cs__.Structure):
        @overload
        def __init__(self): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_DATUM_UNICODE: TypeAlias = _FVE_DATUM_UNICODE
    class _FVE_DATUM_STRETCH_KEY(__cs__.Structure):
        KeyType: _c_bde.uint16
        KeyFlags: _c_bde.uint16
        Salt: __cs__.CharArray
        @overload
        def __init__(
            self,
            KeyType: _c_bde.uint16 | None = ...,
            KeyFlags: _c_bde.uint16 | None = ...,
            Salt: __cs__.CharArray | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_DATUM_STRETCH_KEY: TypeAlias = _FVE_DATUM_STRETCH_KEY
    class _FVE_DATUM_USE_KEY(__cs__.Structure):
        h: _c_bde._FVE_DATUM
        KeyType: _c_bde.uint16
        KeyFlags: _c_bde.uint16
        @overload
        def __init__(
            self,
            h: _c_bde._FVE_DATUM | None = ...,
            KeyType: _c_bde.uint16 | None = ...,
            KeyFlags: _c_bde.uint16 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_DATUM_USE_KEY: TypeAlias = _FVE_DATUM_USE_KEY
    class _FVE_NONCE(__cs__.Structure):
        DateTime: _c_bde.uint64
        Counter: _c_bde.uint32
        @overload
        def __init__(self, DateTime: _c_bde.uint64 | None = ..., Counter: _c_bde.uint32 | None = ...): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_NONCE: TypeAlias = _FVE_NONCE
    class _FVE_DATUM_AESCCM_ENC(__cs__.Structure):
        Nonce: _c_bde._FVE_NONCE
        MAC: __cs__.CharArray
        @overload
        def __init__(self, Nonce: _c_bde._FVE_NONCE | None = ..., MAC: __cs__.CharArray | None = ...): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_DATUM_AESCCM_ENC: TypeAlias = _FVE_DATUM_AESCCM_ENC
    class _FVE_DATUM_TPM_ENC_BLOB(__cs__.Structure):
        PcrBitmap: _c_bde.uint32
        @overload
        def __init__(self, PcrBitmap: _c_bde.uint32 | None = ...): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_DATUM_TPM_ENC_BLOB: TypeAlias = _FVE_DATUM_TPM_ENC_BLOB
    class _FVE_DATUM_VALIDATION_ENTRY(__cs__.Structure):
        EntryType: _c_bde.uint16
        EntryPolicy: _c_bde.uint16
        BcdType: _c_bde.uint32
        Hash: __cs__.CharArray
        @overload
        def __init__(
            self,
            EntryType: _c_bde.uint16 | None = ...,
            EntryPolicy: _c_bde.uint16 | None = ...,
            BcdType: _c_bde.uint32 | None = ...,
            Hash: __cs__.CharArray | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_DATUM_VALIDATION_ENTRY: TypeAlias = _FVE_DATUM_VALIDATION_ENTRY
    class _FVE_DATUM_VALIDATION_INFO(__cs__.Structure):
        @overload
        def __init__(self): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_DATUM_VALIDATION_INFO: TypeAlias = _FVE_DATUM_VALIDATION_INFO
    class _FVE_DATUM_VMK_INFO(__cs__.Structure):
        Identifier: __cs__.CharArray
        DateTime: _c_bde.uint64
        VmkHints: _c_bde.uint16
        Priority: _c_bde.uint16
        @overload
        def __init__(
            self,
            Identifier: __cs__.CharArray | None = ...,
            DateTime: _c_bde.uint64 | None = ...,
            VmkHints: _c_bde.uint16 | None = ...,
            Priority: _c_bde.uint16 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_DATUM_VMK_INFO: TypeAlias = _FVE_DATUM_VMK_INFO
    class _FVE_DATUM_EXTERNAL_INFO(__cs__.Structure):
        Identifier: __cs__.CharArray
        DateTime: _c_bde.uint64
        @overload
        def __init__(self, Identifier: __cs__.CharArray | None = ..., DateTime: _c_bde.uint64 | None = ...): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_DATUM_EXTERNAL_INFO: TypeAlias = _FVE_DATUM_EXTERNAL_INFO
    class _FVE_DATUM_UPDATE(__cs__.Structure):
        UpdateFlags: _c_bde.uint32
        RmwSignature: __cs__.CharArray
        @overload
        def __init__(self, UpdateFlags: _c_bde.uint32 | None = ..., RmwSignature: __cs__.CharArray | None = ...): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_DATUM_UPDATE: TypeAlias = _FVE_DATUM_UPDATE
    class _FVE_DATUM_ERROR_LOG(__cs__.Structure):
        ErrorCode: _c_bde.uint32
        Status: _c_bde.int32
        VolumeId: __cs__.CharArray
        OptionalId: __cs__.CharArray
        Flags: _c_bde.uint32
        @overload
        def __init__(
            self,
            ErrorCode: _c_bde.uint32 | None = ...,
            Status: _c_bde.int32 | None = ...,
            VolumeId: __cs__.CharArray | None = ...,
            OptionalId: __cs__.CharArray | None = ...,
            Flags: _c_bde.uint32 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_DATUM_ERROR_LOG: TypeAlias = _FVE_DATUM_ERROR_LOG
    class _FVE_DATUM_ASYM_ENC_BLOB(__cs__.Structure):
        @overload
        def __init__(self): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_DATUM_ASYM_ENC_BLOB: TypeAlias = _FVE_DATUM_ASYM_ENC_BLOB
    class _FVE_DATUM_EXPORTED_PUBLIC_KEY(__cs__.Structure):
        @overload
        def __init__(self): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_DATUM_EXPORTED_PUBLIC_KEY: TypeAlias = _FVE_DATUM_EXPORTED_PUBLIC_KEY
    class _FVE_DATUM_PUBLIC_KEY_INFO(__cs__.Structure):
        @overload
        def __init__(self): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_DATUM_PUBLIC_KEY_INFO: TypeAlias = _FVE_DATUM_PUBLIC_KEY_INFO
    class _FVE_DATUM_VIRTUALIZATION_INFO(__cs__.Structure):
        VirtualizedBlockOffset: _c_bde.uint64
        VirtualizedBlockSize: _c_bde.uint64
        @overload
        def __init__(
            self, VirtualizedBlockOffset: _c_bde.uint64 | None = ..., VirtualizedBlockSize: _c_bde.uint64 | None = ...
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_DATUM_VIRTUALIZATION_INFO: TypeAlias = _FVE_DATUM_VIRTUALIZATION_INFO
    class _FVE_DATUM_CONCAT_HASH_KEY(__cs__.Structure):
        ConcatHashBuffer: __cs__.CharArray
        @overload
        def __init__(self, ConcatHashBuffer: __cs__.CharArray | None = ...): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_DATUM_CONCAT_HASH_KEY: TypeAlias = _FVE_DATUM_CONCAT_HASH_KEY
    class _FVE_DATUM_BACKUP_INFO(__cs__.Structure):
        CreateDateTime: _c_bde.uint64
        BackupDateTime: _c_bde.uint64
        Type: _c_bde.uint16
        Flags: _c_bde.uint16
        @overload
        def __init__(
            self,
            CreateDateTime: _c_bde.uint64 | None = ...,
            BackupDateTime: _c_bde.uint64 | None = ...,
            Type: _c_bde.uint16 | None = ...,
            Flags: _c_bde.uint16 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_DATUM_BACKUP_INFO: TypeAlias = _FVE_DATUM_BACKUP_INFO
    class _FVE_DATUM_AESCBC256_HMAC_SHA512_ENC(__cs__.Structure):
        Iv: __cs__.CharArray
        Mac: __cs__.CharArray
        @overload
        def __init__(self, Iv: __cs__.CharArray | None = ..., Mac: __cs__.CharArray | None = ...): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_DATUM_AESCBC256_HMAC_SHA512_ENC: TypeAlias = _FVE_DATUM_AESCBC256_HMAC_SHA512_ENC
    class FVE_ARCHITECTURE(__cs__.Enum):
        FVE_ARCH_UNKNOWN = ...
        FVE_ARCH_X86 = ...
        FVE_ARCH_X64 = ...
        FVE_ARCH_ARM = ...
        FVE_ARCH_ARM64 = ...

    class _FVE_EXTENDED_INFORMATION_V1(__cs__.Structure):
        StructureVersion: _c_bde.uint16
        StructureSize: _c_bde.uint16
        WipeFilesMax: _c_bde.uint32
        FveFlags: _c_bde.uint64
        @overload
        def __init__(
            self,
            StructureVersion: _c_bde.uint16 | None = ...,
            StructureSize: _c_bde.uint16 | None = ...,
            WipeFilesMax: _c_bde.uint32 | None = ...,
            FveFlags: _c_bde.uint64 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_EXTENDED_INFORMATION_V1: TypeAlias = _FVE_EXTENDED_INFORMATION_V1
    class _FVE_EXTENDED_INFORMATION_V2(__cs__.Structure):
        StructureVersion: _c_bde.uint16
        StructureSize: _c_bde.uint16
        WipeFilesMax: _c_bde.uint32
        FveFlags: _c_bde.uint64
        ConvLogOffset: _c_bde.uint64
        ConvLogSize: _c_bde.uint32
        OriginalSectorSize: _c_bde.uint32
        @overload
        def __init__(
            self,
            StructureVersion: _c_bde.uint16 | None = ...,
            StructureSize: _c_bde.uint16 | None = ...,
            WipeFilesMax: _c_bde.uint32 | None = ...,
            FveFlags: _c_bde.uint64 | None = ...,
            ConvLogOffset: _c_bde.uint64 | None = ...,
            ConvLogSize: _c_bde.uint32 | None = ...,
            OriginalSectorSize: _c_bde.uint32 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_EXTENDED_INFORMATION_V2: TypeAlias = _FVE_EXTENDED_INFORMATION_V2
    class _FVE_EXTENDED_INFORMATION_V3(__cs__.Structure):
        StructureVersion: _c_bde.uint16
        StructureSize: _c_bde.uint16
        WipeFilesMax: _c_bde.uint32
        FveFlags: _c_bde.uint64
        ConvLogOffset: _c_bde.uint64
        ConvLogSize: _c_bde.uint32
        OriginalSectorSize: _c_bde.uint32
        OriginalNativeSectorSize: _c_bde.uint32
        @overload
        def __init__(
            self,
            StructureVersion: _c_bde.uint16 | None = ...,
            StructureSize: _c_bde.uint16 | None = ...,
            WipeFilesMax: _c_bde.uint32 | None = ...,
            FveFlags: _c_bde.uint64 | None = ...,
            ConvLogOffset: _c_bde.uint64 | None = ...,
            ConvLogSize: _c_bde.uint32 | None = ...,
            OriginalSectorSize: _c_bde.uint32 | None = ...,
            OriginalNativeSectorSize: _c_bde.uint32 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_EXTENDED_INFORMATION_V3: TypeAlias = _FVE_EXTENDED_INFORMATION_V3
    class _FVE_EXTENDED_INFORMATION_V4(__cs__.Structure):
        StructureVersion: _c_bde.uint16
        StructureSize: _c_bde.uint16
        WipeFilesMax: _c_bde.uint32
        FveFlags: _c_bde.uint64
        ConvLogOffset: _c_bde.uint64
        ConvLogSize: _c_bde.uint32
        OriginalSectorSize: _c_bde.uint32
        OriginalNativeSectorSize: _c_bde.uint32
        InitOSMajorVersion: _c_bde.uint32
        InitOSMinorVersion: _c_bde.uint32
        InitOSBuildNumber: _c_bde.uint32
        InitOSPlatformId: _c_bde.uint32
        InitOSServicePackMajor: _c_bde.uint16
        InitOSServicePackMinor: _c_bde.uint16
        InitOSSuiteMask: _c_bde.uint16
        InitOSProductType: _c_bde.uint8
        InitOSArchitecture: _c_bde.uint8
        @overload
        def __init__(
            self,
            StructureVersion: _c_bde.uint16 | None = ...,
            StructureSize: _c_bde.uint16 | None = ...,
            WipeFilesMax: _c_bde.uint32 | None = ...,
            FveFlags: _c_bde.uint64 | None = ...,
            ConvLogOffset: _c_bde.uint64 | None = ...,
            ConvLogSize: _c_bde.uint32 | None = ...,
            OriginalSectorSize: _c_bde.uint32 | None = ...,
            OriginalNativeSectorSize: _c_bde.uint32 | None = ...,
            InitOSMajorVersion: _c_bde.uint32 | None = ...,
            InitOSMinorVersion: _c_bde.uint32 | None = ...,
            InitOSBuildNumber: _c_bde.uint32 | None = ...,
            InitOSPlatformId: _c_bde.uint32 | None = ...,
            InitOSServicePackMajor: _c_bde.uint16 | None = ...,
            InitOSServicePackMinor: _c_bde.uint16 | None = ...,
            InitOSSuiteMask: _c_bde.uint16 | None = ...,
            InitOSProductType: _c_bde.uint8 | None = ...,
            InitOSArchitecture: _c_bde.uint8 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_EXTENDED_INFORMATION_V4: TypeAlias = _FVE_EXTENDED_INFORMATION_V4
    class _FVE_EXTENDED_INFORMATION_V5(__cs__.Structure):
        StructureVersion: _c_bde.uint16
        StructureSize: _c_bde.uint16
        WipeFilesMax: _c_bde.uint32
        FveFlags: _c_bde.uint64
        ConvLogOffset: _c_bde.uint64
        ConvLogSize: _c_bde.uint32
        OriginalSectorSize: _c_bde.uint32
        OriginalNativeSectorSize: _c_bde.uint32
        InitOSMajorVersion: _c_bde.uint32
        InitOSMinorVersion: _c_bde.uint32
        InitOSBuildNumber: _c_bde.uint32
        InitOSPlatformId: _c_bde.uint32
        InitOSServicePackMajor: _c_bde.uint16
        InitOSServicePackMinor: _c_bde.uint16
        InitOSSuiteMask: _c_bde.uint16
        InitOSProductType: _c_bde.uint8
        InitOSArchitecture: _c_bde.uint8
        IceVerifyOffset: _c_bde.uint64
        IceVerifySize: _c_bde.uint64
        @overload
        def __init__(
            self,
            StructureVersion: _c_bde.uint16 | None = ...,
            StructureSize: _c_bde.uint16 | None = ...,
            WipeFilesMax: _c_bde.uint32 | None = ...,
            FveFlags: _c_bde.uint64 | None = ...,
            ConvLogOffset: _c_bde.uint64 | None = ...,
            ConvLogSize: _c_bde.uint32 | None = ...,
            OriginalSectorSize: _c_bde.uint32 | None = ...,
            OriginalNativeSectorSize: _c_bde.uint32 | None = ...,
            InitOSMajorVersion: _c_bde.uint32 | None = ...,
            InitOSMinorVersion: _c_bde.uint32 | None = ...,
            InitOSBuildNumber: _c_bde.uint32 | None = ...,
            InitOSPlatformId: _c_bde.uint32 | None = ...,
            InitOSServicePackMajor: _c_bde.uint16 | None = ...,
            InitOSServicePackMinor: _c_bde.uint16 | None = ...,
            InitOSSuiteMask: _c_bde.uint16 | None = ...,
            InitOSProductType: _c_bde.uint8 | None = ...,
            InitOSArchitecture: _c_bde.uint8 | None = ...,
            IceVerifyOffset: _c_bde.uint64 | None = ...,
            IceVerifySize: _c_bde.uint64 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_EXTENDED_INFORMATION_V5: TypeAlias = _FVE_EXTENDED_INFORMATION_V5
    class _FVE_EOW_INFORMATION(__cs__.Structure):
        HeaderSignature: __cs__.CharArray
        HeaderSize: _c_bde.uint16
        Size: _c_bde.uint16
        SectorSize: _c_bde.uint32
        AtomicAlignment: _c_bde.uint32
        ChunkSize: _c_bde.uint32
        ConvLogSize: _c_bde.uint32
        ConvLogRecordSize: _c_bde.uint32
        RegionCount: _c_bde.uint32
        Crc32: _c_bde.uint32
        EowOffset: __cs__.Array[_c_bde.uint64]
        BitmapOffsets: __cs__.Array[_c_bde.uint64]
        @overload
        def __init__(
            self,
            HeaderSignature: __cs__.CharArray | None = ...,
            HeaderSize: _c_bde.uint16 | None = ...,
            Size: _c_bde.uint16 | None = ...,
            SectorSize: _c_bde.uint32 | None = ...,
            AtomicAlignment: _c_bde.uint32 | None = ...,
            ChunkSize: _c_bde.uint32 | None = ...,
            ConvLogSize: _c_bde.uint32 | None = ...,
            ConvLogRecordSize: _c_bde.uint32 | None = ...,
            RegionCount: _c_bde.uint32 | None = ...,
            Crc32: _c_bde.uint32 | None = ...,
            EowOffset: __cs__.Array[_c_bde.uint64] | None = ...,
            BitmapOffsets: __cs__.Array[_c_bde.uint64] | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_EOW_INFORMATION: TypeAlias = _FVE_EOW_INFORMATION
    class _FVE_EOW_BITMAP(__cs__.Structure):
        HeaderSignature: __cs__.CharArray
        HeaderSize: _c_bde.uint16
        Size: _c_bde.uint32
        Index: _c_bde.uint32
        RegionOffset: _c_bde.uint64
        RegionSize: _c_bde.uint64
        ConvLogOffset: _c_bde.uint64
        RecordOffset: __cs__.Array[_c_bde.uint32]
        RecordSize: _c_bde.uint32
        Crc32: _c_bde.uint32
        @overload
        def __init__(
            self,
            HeaderSignature: __cs__.CharArray | None = ...,
            HeaderSize: _c_bde.uint16 | None = ...,
            Size: _c_bde.uint32 | None = ...,
            Index: _c_bde.uint32 | None = ...,
            RegionOffset: _c_bde.uint64 | None = ...,
            RegionSize: _c_bde.uint64 | None = ...,
            ConvLogOffset: _c_bde.uint64 | None = ...,
            RecordOffset: __cs__.Array[_c_bde.uint32] | None = ...,
            RecordSize: _c_bde.uint32 | None = ...,
            Crc32: _c_bde.uint32 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_EOW_BITMAP: TypeAlias = _FVE_EOW_BITMAP
    class _FVE_EOW_BITMAP_RECORD(__cs__.Structure):
        HeaderSignature: __cs__.CharArray
        HeaderSize: _c_bde.uint16
        Size: _c_bde.uint32
        BitmapSize: _c_bde.uint32
        SequenceNumber: _c_bde.uint64
        Flags: _c_bde.uint32
        Crc32: _c_bde.uint32
        @overload
        def __init__(
            self,
            HeaderSignature: __cs__.CharArray | None = ...,
            HeaderSize: _c_bde.uint16 | None = ...,
            Size: _c_bde.uint32 | None = ...,
            BitmapSize: _c_bde.uint32 | None = ...,
            SequenceNumber: _c_bde.uint64 | None = ...,
            Flags: _c_bde.uint32 | None = ...,
            Crc32: _c_bde.uint32 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_EOW_BITMAP_RECORD: TypeAlias = _FVE_EOW_BITMAP_RECORD
    class _FVE_CONVLOG_HDR(__cs__.Structure):
        Magic: __cs__.CharArray
        StructureSize: _c_bde.uint16
        StructureVersion: _c_bde.uint16
        FvePersistState: _c_bde.uint16
        SectorSize: _c_bde.uint32
        VolumeSize: _c_bde.uint64
        ConvBlockSize: _c_bde.uint32
        LogRecordSize: _c_bde.uint32
        LogFactor: _c_bde.uint32
        LogRecordCount: _c_bde.uint32
        Watermark: _c_bde.uint64
        @overload
        def __init__(
            self,
            Magic: __cs__.CharArray | None = ...,
            StructureSize: _c_bde.uint16 | None = ...,
            StructureVersion: _c_bde.uint16 | None = ...,
            FvePersistState: _c_bde.uint16 | None = ...,
            SectorSize: _c_bde.uint32 | None = ...,
            VolumeSize: _c_bde.uint64 | None = ...,
            ConvBlockSize: _c_bde.uint32 | None = ...,
            LogRecordSize: _c_bde.uint32 | None = ...,
            LogFactor: _c_bde.uint32 | None = ...,
            LogRecordCount: _c_bde.uint32 | None = ...,
            Watermark: _c_bde.uint64 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_CONVLOG_HDR: TypeAlias = _FVE_CONVLOG_HDR
    class _FVE_CONVLOG_RECORD_HDR(__cs__.Structure):
        StructureSize: _c_bde.uint16
        StructureVersion: _c_bde.uint16
        Lsn: _c_bde.uint64
        Watermark: _c_bde.uint64
        RecordBodySize: _c_bde.uint32
        RecordBodyChecksum: _c_bde.uint32
        HeaderChecksum: _c_bde.uint32
        @overload
        def __init__(
            self,
            StructureSize: _c_bde.uint16 | None = ...,
            StructureVersion: _c_bde.uint16 | None = ...,
            Lsn: _c_bde.uint64 | None = ...,
            Watermark: _c_bde.uint64 | None = ...,
            RecordBodySize: _c_bde.uint32 | None = ...,
            RecordBodyChecksum: _c_bde.uint32 | None = ...,
            HeaderChecksum: _c_bde.uint32 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    FVE_CONVLOG_RECORD_HDR: TypeAlias = _FVE_CONVLOG_RECORD_HDR

# Technically `c_bde` is an instance of `_c_bde`, but then we can't use it in type hints
c_bde: TypeAlias = _c_bde

FVE_STATE = c_bde.FVE_STATE
FVE_KEY_TYPE = c_bde.FVE_KEY_TYPE
FVE_KEY_FLAG = c_bde.FVE_KEY_FLAG
FVE_KEY_PROTECTOR = c_bde.FVE_KEY_PROTECTOR

FVE_DATUM_ROLE = c_bde.FVE_DATUM_ROLE
FVE_DATUM_TYPE = c_bde.FVE_DATUM_TYPE

# Volume signatures
BITLOCKER_SIGNATURE: Literal[b"-FVE-FS-"]
BITLOCKER_TO_GO_SIGNATURE: Literal[b"MSWIN4.1"]

EOW_SIGNATURE: Literal[b"FVE-EOW\x00"]
EOW_BM_SIGNATURE: Literal[b"FVE-EOWBM\x00"]
EOW_BR_SIGNATURE: Literal[b"FVE-EOWBR\x00"]

CONV_MAGIC: Literal[b"OLRDHEVF"]  # b"FVEHDRLO"[::-1]

INFORMATION_OFFSET_GUID: Literal["4967d63b-2e29-4ad8-8399-f6a339e3d001"]
EOW_INFORMATION_OFFSET_GUID: Literal["92a84d3b-dd80-4d0e-9e4e-b1e3284eaed8"]

CIPHER_MAP: dict[FVE_KEY_TYPE, str]
