Skip to content

Commit

Permalink
sdk-py: Add random to Point
Browse files Browse the repository at this point in the history
  • Loading branch information
freerangedev authored and parazyd committed Jun 15, 2023
1 parent ac60889 commit 03e39f2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/sdk/python/src/point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 03e39f2

Please sign in to comment.