pub struct Scalar(/* private fields */);
Expand description
P-192 scalar: integers mod n, where n = 0xFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF (curve order).
Implementations§
Source§impl Scalar
impl Scalar
Sourcepub fn new(data: [u8; 24]) -> Result<Self>
pub fn new(data: [u8; 24]) -> Result<Self>
Create a scalar from raw bytes with reduction mod n. Ensures result ∈ [1, n−1]. Errors if result = 0.
Sourcepub fn from_secret_buffer(
buffer: SecretBuffer<P192_SCALAR_SIZE>,
) -> Result<Self>
pub fn from_secret_buffer( buffer: SecretBuffer<P192_SCALAR_SIZE>, ) -> Result<Self>
Create from existing SecretBuffer (applies reduction & zero check)
Sourcepub fn as_secret_buffer(&self) -> &SecretBuffer<P192_SCALAR_SIZE>
pub fn as_secret_buffer(&self) -> &SecretBuffer<P192_SCALAR_SIZE>
Access the underlying SecretBuffer
Sourcepub fn deserialize(bytes: &[u8]) -> Result<Self>
pub fn deserialize(bytes: &[u8]) -> Result<Self>
Deserialize from bytes (with validation)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Scalar
impl RefUnwindSafe for Scalar
impl Send for Scalar
impl Sync for Scalar
impl Unpin for Scalar
impl UnwindSafe for Scalar
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