pub enum DhError {
PrimeLengthInvalid,
PrimeTooSmall,
PrimeUnknown,
GeneratorOutOfRange,
GeneratorInvalid,
}Expand description
Errors returned by check_p_and_g.
Variants§
PrimeLengthInvalid
dh_prime is not exactly 256 bytes (2048 bits).
PrimeTooSmall
The most-significant bit of dh_prime is zero, so it is actually
shorter than 2048 bits.
PrimeUnknown
dh_prime does not match Telegram’s published safe prime.
GeneratorOutOfRange
g is outside the set {2, 3, 4, 5, 6, 7}.
GeneratorInvalid
The modular-residue condition required by g and the prime is not
satisfied (see MTProto spec §4.5).
Trait Implementations§
Source§impl Error for DhError
impl Error for DhError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
impl Eq for DhError
impl StructuralPartialEq for DhError
Auto Trait Implementations§
impl Freeze for DhError
impl RefUnwindSafe for DhError
impl Send for DhError
impl Sync for DhError
impl Unpin for DhError
impl UnsafeUnpin for DhError
impl UnwindSafe for DhError
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