You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
599 B
39 lines
599 B
//! Offsets for a public key container
|
|
use super::offsets::*;
|
|
use super::*;
|
|
|
|
#[derive(Clone,Copy,Debug,Eq,PartialEq,Hash,Default)]
|
|
#[cfg_attr(feature="serialise", derive(Serialize,Deserialize))]
|
|
pub struct PublicOffsetGroup
|
|
{
|
|
pub n: usize,
|
|
pub e: usize,
|
|
}
|
|
|
|
impl HasOffsets for PublicOffsetGroup
|
|
{
|
|
fn starts(&self) -> Starts<Self>
|
|
{
|
|
Self {
|
|
n: 0,
|
|
e: self.n,
|
|
}.into()
|
|
}
|
|
fn body_len(&self) -> usize
|
|
{
|
|
self.n+self.e
|
|
}
|
|
}
|
|
|
|
impl HasPublicOffsets for PublicOffsetGroup
|
|
{
|
|
fn n(&self) -> usize
|
|
{
|
|
self.n
|
|
}
|
|
fn e(&self) -> usize
|
|
{
|
|
self.e
|
|
}
|
|
}
|