Trait zkgroup::crypto::credentials::AttrScalars

source ·
pub trait AttrScalars {
    type Storage: ArrayLike<Scalar> + Copy + Eq + Serialize + for<'a> Deserialize<'a>;

    const NUM_ATTRS: usize = <Self::Storage>::LEN;
}
Expand description

Used to specialize a KeyPair<S> to support a certain number of attributes.

The only required member is Storage, which should be a fixed-size array of [Scalar], one for each attribute. However, for backwards compatibility some systems support fewer attributes than are actually stored, and in this case the NUM_ATTRS member can be set to a custom value. Note that NUM_ATTRS must always be less than or equal to the number of elements in Storage.

Required Associated Types§

source

type Storage: ArrayLike<Scalar> + Copy + Eq + Serialize + for<'a> Deserialize<'a>

The storage (should be a fixed-size array of Scalar).

Provided Associated Constants§

source

const NUM_ATTRS: usize = <Self::Storage>::LEN

The number of attributes supported in this system.

Defaults to the full set stored in Self::Storage.

Object Safety§

This trait is not object safe.

Implementors§