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.
WidthMismatch
Operands have mismatched bit widths.
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.
NoBuffer
The user-passed memory array did not have a buffer corresponding to a bind instructions buffer index.
AliasingViolation
Encountered multiple bind instructions with the same buffer index.
Fields
buffer_id: usizeThe 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).
OutOfRange
An instruction’s immediate value is too large.
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
impl Error
Sourcepub fn aliasing_violation(inst_id: usize, pc: u32, buffer_id: usize) -> Self
pub fn aliasing_violation(inst_id: usize, pc: u32, buffer_id: usize) -> Self
Create an Error::AliasingViolation.
Sourcepub fn unsupported_width(inst_id: usize, pc: u32) -> Self
pub fn unsupported_width(inst_id: usize, pc: u32) -> Self
Create an Error::UnsupportedWidth.
Sourcepub fn buffer_not_a_plaintext() -> Self
pub fn buffer_not_a_plaintext() -> Self
Create an Error::BufferNotAPlaintext.
Sourcepub fn buffer_not_a_ciphertext() -> Self
pub fn buffer_not_a_ciphertext() -> Self
Create an Error::BufferNotACiphertext.
Sourcepub fn buffer_size_mismatch() -> Self
pub fn buffer_size_mismatch() -> Self
Create an Error::BufferSizeMismatch.
Sourcepub fn uop_ciphertext_mismatch() -> Self
pub fn uop_ciphertext_mismatch() -> Self
Create an Error::UopCiphertextMismatch.
Sourcepub fn out_of_range(inst_id: usize, pc: u32) -> Self
pub fn out_of_range(inst_id: usize, pc: u32) -> Self
Create an Error::OutOfRange.
Sourcepub fn no_buffer(inst_id: usize, pc: u32) -> Self
pub fn no_buffer(inst_id: usize, pc: u32) -> Self
Create an Error::NoBuffer.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<FromBytesUntilNulError> for Error
impl From<FromBytesUntilNulError> for Error
Source§fn from(source: FromBytesUntilNulError) -> Self
fn from(source: FromBytesUntilNulError) -> Self
Source§impl From<ParseError> for Error
impl From<ParseError> for Error
Source§fn from(value: ParseError) -> Self
fn from(value: ParseError) -> Self
Source§impl From<RuntimeError> for Error
impl From<RuntimeError> for Error
Source§fn from(source: RuntimeError) -> Self
fn from(source: RuntimeError) -> Self
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> 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.