Skip to main content

GroupValue

Struct GroupValue 

Source
pub struct GroupValue<G: AbelianGroupBase> { /* private fields */ }
Available on crate feature unstable-enable only.
Expand description

Analogue of RingValue for groups.

§Availability

This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Implementations§

Source§

impl<G: AbelianGroupBase + Sized> GroupValue<G>

Source

pub fn into(self) -> G

§Availability

This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn from_ref<'a>(group: &'a G) -> &'a Self

§Availability

This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source§

impl<R: RingStore> GroupValue<AddGroupBase<R>>
where R::Type: HashableElRing,

Source

pub fn new(ring: R) -> Self

§Availability

This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source§

impl<R: RingStore> GroupValue<MultGroupBase<R>>

Source

pub fn new(ring: R) -> Self

§Availability

This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn underlying_ring(&self) -> &R

§Availability

This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn from_ring_el(&self, x: El<R>) -> Option<MultGroupEl<R>>

If x is contained in R*, returns a MultGroupEl representing x. Otherwise, None is returned.

§Availability

This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn as_ring_el<'a>(&self, x: &'a MultGroupEl<R>) -> &'a El<R>

Returns the ring element represented by the given group element.

§Availability

This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source§

impl<G: AbelianGroupStore> GroupValue<SubgroupBase<G>>

Source

pub fn new( group: G, order_multiple: El<BigIntRing>, generators: Vec<GroupEl<G>>, ) -> Self

Creates a new [GeneratingSet] representing the subgroup generated by the given generators.

The value order_multiple should be a multiple of the order of every generator, including generators that will be added later on via [GeneratingSet::add_generator()].

§Availability

This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn parent(&self) -> &G

Returns the group that this group is a subgroup of.

§Availability

This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn subgroup_order(&self) -> El<BigIntRing>

Returns the order of the subgroup, i.e. the number of elements.

§Availability

This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn generators(&self) -> &[GroupEl<G>]

Returns the stored generating set of the subgroup.

§Availability

This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn add_generator(self, new_gen_base: GroupEl<G>) -> Self

Adds a generator to this subgroup, returning a new, larger subgroup.

§Availability

This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn contains(&self, element: &GroupEl<G>) -> bool

Checks whether the given element of the parent group is contained in the subgroup.

§Availability

This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn dlog(&self, target: &GroupEl<G>) -> Option<Vec<i64>>

Writes the given element of the parent group as a combination of the subgroup generators, if this exists.

§Availability

This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn enumerate_elements<'a>( &'a self, ) -> impl use<'a, G> + Clone + Iterator<Item = GroupEl<G>>

Returns an iterator over all elements of the subgroup.

§Availability

This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source§

impl<R> GroupValue<SubgroupBase<GroupValue<MultGroupBase<R>>>>

Source

pub fn for_zn( group: MultGroup<R>, generators: Vec<GroupEl<MultGroup<R>>>, ) -> Self

§Availability

This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Trait Implementations§

Source§

impl<G: AbelianGroupBase> AbelianGroupStore for GroupValue<G>

Source§

type Type = G

Available on crate feature unstable-enable only.
Source§

fn get_group(&self) -> &Self::Type

Available on crate feature unstable-enable only.
Source§

fn clone_el(&self, el: &GroupEl<Self>) -> GroupEl<Self>

Available on crate feature unstable-enable only.
Source§

fn eq_el(&self, lhs: &GroupEl<Self>, rhs: &GroupEl<Self>) -> bool

Available on crate feature unstable-enable only.
Source§

fn op(&self, lhs: GroupEl<Self>, rhs: GroupEl<Self>) -> GroupEl<Self>

Available on crate feature unstable-enable only.
Source§

fn op_ref(&self, lhs: &GroupEl<Self>, rhs: &GroupEl<Self>) -> GroupEl<Self>

Available on crate feature unstable-enable only.
Source§

fn op_ref_snd(&self, lhs: GroupEl<Self>, rhs: &GroupEl<Self>) -> GroupEl<Self>

Available on crate feature unstable-enable only.
Source§

fn inv(&self, x: &GroupEl<Self>) -> GroupEl<Self>

Available on crate feature unstable-enable only.
Source§

fn identity(&self) -> GroupEl<Self>

Available on crate feature unstable-enable only.
Source§

fn pow(&self, x: &GroupEl<Self>, e: &El<BigIntRing>) -> GroupEl<Self>

Available on crate feature unstable-enable only.
Source§

fn is_identity(&self, x: &GroupEl<Self>) -> bool

Available on crate feature unstable-enable only.
Source§

fn hash<H: Hasher>(&self, x: &GroupEl<Self>, hasher: &mut H)

Available on crate feature unstable-enable only.
Source§

impl<G: AbelianGroupBase + Clone> Clone for GroupValue<G>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'de, G> Deserialize<'de> for GroupValue<G>
where G: Deserialize<'de> + AbelianGroupBase,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<G: AbelianGroupBase> From<G> for GroupValue<G>

Source§

fn from(value: G) -> Self

Converts to this type from the input type.
Source§

impl<G> Serialize for GroupValue<G>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<G: AbelianGroupBase + Copy> Copy for GroupValue<G>

Auto Trait Implementations§

§

impl<G> Freeze for GroupValue<G>
where G: Freeze,

§

impl<G> RefUnwindSafe for GroupValue<G>
where G: RefUnwindSafe,

§

impl<G> Send for GroupValue<G>
where G: Send,

§

impl<G> Sync for GroupValue<G>
where G: Sync,

§

impl<G> Unpin for GroupValue<G>
where G: Unpin,

§

impl<G> UnsafeUnpin for GroupValue<G>
where G: UnsafeUnpin,

§

impl<G> UnwindSafe for GroupValue<G>
where G: UnwindSafe,

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> 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, 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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,