mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
sdk-py: Add random to Point
This commit is contained in:
@@ -33,6 +33,7 @@ use darkfi_sdk::{
|
||||
};
|
||||
use halo2_gadgets::ecc::chip::FixedPoint;
|
||||
use pyo3::{basic::CompareOp, prelude::*};
|
||||
use rand::rngs::OsRng;
|
||||
|
||||
use super::{affine::Affine, base::Base, scalar::Scalar};
|
||||
|
||||
@@ -75,6 +76,11 @@ impl Point {
|
||||
Self(r.0 * blind.0)
|
||||
}
|
||||
|
||||
#[staticmethod]
|
||||
fn random() -> Self {
|
||||
Self(pallas::Point::random(&mut OsRng))
|
||||
}
|
||||
|
||||
fn __str__(&self) -> String {
|
||||
format!("{:?}", self.0)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user