Skip to main content

Error

Enum Error 

Source
pub enum Error {
Show 42 variants CircuitError(RuntimeError), IllegalInstruction(u32), IllegalOperands { inst_id: usize, pc: u32, }, WidthMismatch { inst_id: usize, pc: u32, }, UnalignedAccess(u32), RegisterMutabilityViolation, BufferMismatch { inst_id: usize, pc: u32, }, NoBuffer { inst_id: usize, pc: u32, }, AliasingViolation { inst_id: usize, pc: u32, buffer_id: usize, }, AccessViolation(u32), UnsupportedWidth { inst_id: usize, pc: u32, }, OutOfRange { inst_id: usize, pc: u32, }, BufferNotAPlaintext, BufferNotACiphertext, BufferSizeMismatch, MixedData, EncryptionMismatch, IllegalUop, UopCiphertextMismatch, BranchConditionNotPlaintext, Halt, ElfNoSectionHeaders, ElfParseError(String), ElfMalformedString(FromBytesUntilNulError), ElfUnreachable, ElfUnsupportedAbiVersion(u8), ElfNoSymbolTable, ElfNoSegmentTable, ElfNotElf32, ElfBadSymbolValue, ElfSymbolNotFound(String), ElfByteOutOfBounds(u32), VirtualAddressInUse, CStringCreationError(NulError), NoContiguousChunk(u32), ZeroAllocation, PointerOverflow, OutOfGas(u32, u32), UnexpectedEncryptedByte(u32), WordConversionTooManyBytes, NotAByte, TypeSizeMismatch,
}
Expand description

Errors that can occur in this crate.

Variants§

§

CircuitError(RuntimeError)

An error occurred when running a circuit on a parasol_runtime::CircuitProcessor.

§

IllegalInstruction(u32)

Illegal instruction.

§

IllegalOperands

Illegal operands to an instruction.

Fields

§inst_id: usize

The faulting instruction’s id.

§pc: u32

The program counter at time of error.

§

WidthMismatch

Operands have mismatched bit widths.

Fields

§inst_id: usize

The faulting instruction’s id.

§pc: u32

The program counter at time of error.

§

UnalignedAccess(u32)

The instruction attempted an unaligned memory operation.

§

RegisterMutabilityViolation

Processor violated a register mutability invariant. This is an internal error and should be reported as a bug.

§

BufferMismatch

A bind instruction attempted to bind a buffer of a different encrypted-ness than the bind instruction specified.

Fields

§inst_id: usize

The faulting instruction’s id.

§pc: u32

The program counter at time of error.

§

NoBuffer

The user-passed memory array did not have a buffer corresponding to a bind instructions buffer index.

Fields

§inst_id: usize

The faulting instruction’s id.

§pc: u32

The program counter at time of error.

§

AliasingViolation

Encountered multiple bind instructions with the same buffer index.

Fields

§inst_id: usize

The faulting instruction’s id.

§pc: u32

The program counter at time of error.

§buffer_id: usize

The buffer’s index in a call to crate::FheComputer::run_program.

§

AccessViolation(u32)

A load or store occured out of a memory’s bounds.

§

UnsupportedWidth

Cannot load or store a value of the requested width (> 128 bits).

Fields

§inst_id: usize

The faulting instruction’s id.

§pc: u32

The program counter at time of error.

§

OutOfRange

An instruction’s immediate value is too large.

Fields

§inst_id: usize

The faulting instruction’s id.

§pc: u32

The program counter at time of error.

§

BufferNotAPlaintext

The given buffer wasn’t a plaintext.

§

BufferNotACiphertext

The given buffer wasn’t encrypted.

§

BufferSizeMismatch

The buffer had the wrong size.

§

MixedData

Attempted to mix plaintext and ciphertext data in a multi-byte type.

§

EncryptionMismatch

Encountered a different byte encrypted-ness than expected.

§

IllegalUop

Encountered an illegal micro-op. This is a bug.

§

UopCiphertextMismatch

A micro-op encountered an unexpected ciphertext type. This is a bug.

§

BranchConditionNotPlaintext

Attempted to branch on an encrypted value.

§

Halt

Internally used to signal a program halting. Should never be encountered.

§

ElfNoSectionHeaders

The given ELF file is not runnable. It has no section headers.

§

ElfParseError(String)

Failed to parse the given ELF file.

§

ElfMalformedString(FromBytesUntilNulError)

Encountered an illegal string in the given ELF program.

§

ElfUnreachable

An unexpected error occurred. This should never happen.

§

ElfUnsupportedAbiVersion(u8)

Attempted to load an elf file with an unsupported ABI version.

§

ElfNoSymbolTable

The ELF file lacks a symbol table, and thus cannot be loaded.

§

ElfNoSegmentTable

The ELF file lacks a segment table, and thus cannot be loaded.

§

ElfNotElf32

The given ELF file is ELF64.

§

ElfBadSymbolValue

Encountered an STT_FUNC symbol out of range.

§

ElfSymbolNotFound(String)

The specified symbol does not exist the ELF file.

§

ElfByteOutOfBounds(u32)

When parsing the ELF file, encountered an out-of-bounds file offset.

§

VirtualAddressInUse

Attempted to allocate a virtual address that’s already mapped.

§

CStringCreationError(NulError)

Failed to create a std::ffi::CString`

§

NoContiguousChunk(u32)

Cannot fulfill the given mmap request as no contiguous address region exists of the requested length

§

ZeroAllocation

Attempted to mmap zero bytes.

§

PointerOverflow

Attempted an operation that resulted in pointer overflow.

§

OutOfGas(u32, u32)

Running out of allowed fee quota

§

UnexpectedEncryptedByte(u32)

The given byte should have been a plaintext, but was encrypted

§

WordConversionTooManyBytes

Too many bytes given to Word::try_from().

§

NotAByte

When trying to convert to an encrypted byte, found more or less than 8 bits.

§

TypeSizeMismatch

Attempted to create a value from an incorrect number of bytes.

Implementations§

Source§

impl Error

Source

pub fn aliasing_violation(inst_id: usize, pc: u32, buffer_id: usize) -> Self

Source

pub fn unsupported_width(inst_id: usize, pc: u32) -> Self

Source

pub fn buffer_not_a_plaintext() -> Self

Source

pub fn buffer_not_a_ciphertext() -> Self

Source

pub fn buffer_size_mismatch() -> Self

Source

pub fn uop_ciphertext_mismatch() -> Self

Source

pub fn out_of_range(inst_id: usize, pc: u32) -> Self

Create an Error::OutOfRange.

Source

pub fn no_buffer(inst_id: usize, pc: u32) -> Self

Create an Error::NoBuffer.

Trait Implementations§

Source§

impl Clone for Error

Source§

fn clone(&self) -> Error

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for Error

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<FromBytesUntilNulError> for Error

Source§

fn from(source: FromBytesUntilNulError) -> Self

Converts to this type from the input type.
Source§

impl From<NulError> for Error

Source§

fn from(source: NulError) -> Self

Converts to this type from the input type.
Source§

impl From<ParseError> for Error

Source§

fn from(value: ParseError) -> Self

Converts to this type from the input type.
Source§

impl From<RuntimeError> for Error

Source§

fn from(source: RuntimeError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V