pub struct HsIdKeypair(ExpandedKeypair);
Expand description
The private counterpart of a [`HsIdKeyKey’].
This is stored as an expanded secret key, for compatibility with the C tor implementation, and in order to support custom-generated addresses.
(About custom generated addresses: When making a vanity onion address,
it is inefficient to search for a compact secret key s
and compute
SHA512(s)=(a,r)
and A=aB
until you find an s
that produces an A
that you like. Instead, most folks use the algorithm of
rend-spec-v3.txt appendix C, wherein you search for a good a
directly
by repeatedly adding 8B
to A until you find an A
you like. The only
major drawback is that once you have found a good a
, you can’t get an
s
for it, since you presumably can’t find SHA512 preimages. And that
is why we store the private key in (a,r) form.)
Tuple Fields§
§0: ExpandedKeypair
Implementations§
Source§impl HsIdKeypair
impl HsIdKeypair
Sourcepub fn compute_blinded_key(
&self,
cur_period: TimePeriod,
) -> Result<(HsBlindIdKey, HsBlindIdKeypair, Subcredential), BlindingError>
pub fn compute_blinded_key( &self, cur_period: TimePeriod, ) -> Result<(HsBlindIdKey, HsBlindIdKeypair, Subcredential), BlindingError>
Derive the blinded key and subcredential for this identity during cur_period
.
Trait Implementations§
Source§impl AsRef<ExpandedKeypair> for HsIdKeypair
impl AsRef<ExpandedKeypair> for HsIdKeypair
Source§fn as_ref(&self) -> &ExpandedKeypair
fn as_ref(&self) -> &ExpandedKeypair
Source§impl Debug for HsIdKeypair
impl Debug for HsIdKeypair
Source§impl From<&HsIdKeypair> for HsIdKey
impl From<&HsIdKeypair> for HsIdKey
Source§fn from(value: &HsIdKeypair) -> Self
fn from(value: &HsIdKeypair) -> Self
Source§impl From<ExpandedKeypair> for HsIdKeypair
impl From<ExpandedKeypair> for HsIdKeypair
Source§fn from(value: ExpandedKeypair) -> Self
fn from(value: ExpandedKeypair) -> Self
Source§impl From<HsIdKeypair> for ExpandedKeypair
impl From<HsIdKeypair> for ExpandedKeypair
Source§fn from(value: HsIdKeypair) -> Self
fn from(value: HsIdKeypair) -> Self
Source§impl From<HsIdKeypair> for HsIdKey
impl From<HsIdKeypair> for HsIdKey
Source§fn from(value: HsIdKeypair) -> Self
fn from(value: HsIdKeypair) -> Self
Source§impl ToEncodableKey for HsIdKeypair
impl ToEncodableKey for HsIdKeypair
Source§type Key = ExpandedKeypair
type Key = ExpandedKeypair
Source§type KeyPair = HsIdKeypair
type KeyPair = HsIdKeypair
Source§fn to_encodable_key(self) -> Self::Key
fn to_encodable_key(self) -> Self::Key
EncodableItem
.Source§fn from_encodable_key(key: Self::Key) -> Self
fn from_encodable_key(key: Self::Key) -> Self
EncodableItem
to another key type.Auto Trait Implementations§
impl Freeze for HsIdKeypair
impl RefUnwindSafe for HsIdKeypair
impl Send for HsIdKeypair
impl Sync for HsIdKeypair
impl Unpin for HsIdKeypair
impl UnwindSafe for HsIdKeypair
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 more