sdk-py: Add random to Point

This commit is contained in:
freerangedev
2023-06-14 19:01:52 +00:00
committed by parazyd
parent ac6088964c
commit 03e39f263f

View File

@@ -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)
}