From 3bb14e7ddb72c3d205f9776d875d5ec8d67029d1 Mon Sep 17 00:00:00 2001 From: sergey-shandar Date: Wed, 31 Jul 2024 01:19:53 -0700 Subject: [PATCH] scalar --- blockset-lib/src/secp256k1/mod.rs | 4 ---- blockset-lib/src/secp256k1/nonce.rs | 7 ++----- blockset-lib/src/secp256k1/point.rs | 2 +- blockset-lib/src/secp256k1/scalar.rs | 5 ----- 4 files changed, 3 insertions(+), 15 deletions(-) diff --git a/blockset-lib/src/secp256k1/mod.rs b/blockset-lib/src/secp256k1/mod.rs index abebd715..a872d322 100644 --- a/blockset-lib/src/secp256k1/mod.rs +++ b/blockset-lib/src/secp256k1/mod.rs @@ -6,8 +6,6 @@ mod scalar; use field::Field; use point::{Point, G}; -use crate::sha2::be_chunk::BeChunk; - type Order = Field<0xBAAEDCE6_AF48A03B_BFD25E8C_D0364141, 0xFFFFFFFF_FFFFFFFF_FFFFFFFF_FFFFFFFE>; type Signature = [Order; 2]; @@ -36,8 +34,6 @@ const fn verify(pub_key: Point, z: Order, [r, s]: Signature) -> bool { mod tests { use wasm_bindgen_test::wasm_bindgen_test; - //use crate::hmac::hmac; - use super::{verify, Order}; #[test] diff --git a/blockset-lib/src/secp256k1/nonce.rs b/blockset-lib/src/secp256k1/nonce.rs index 487dbe84..7906f4e8 100644 --- a/blockset-lib/src/secp256k1/nonce.rs +++ b/blockset-lib/src/secp256k1/nonce.rs @@ -69,11 +69,8 @@ mod tests { use crate::{ secp256k1::nonce::nonce, - sha2::{be_chunk::BeChunk, sha256::SHA256, state::State}, - uint::{ - u256x::{self, U256}, - u512x, - }, + sha2::{sha256::SHA256, state::State}, + uint::u256x::{self, U256}, }; #[test] diff --git a/blockset-lib/src/secp256k1/point.rs b/blockset-lib/src/secp256k1/point.rs index f5aa06c9..4f0b1245 100644 --- a/blockset-lib/src/secp256k1/point.rs +++ b/blockset-lib/src/secp256k1/point.rs @@ -1,6 +1,6 @@ use core::panic; -use crate::uint::u256x::{self, U256}; +use crate::uint::u256x; use super::{scalar::Scalar, Order}; diff --git a/blockset-lib/src/secp256k1/scalar.rs b/blockset-lib/src/secp256k1/scalar.rs index d963c717..3ef2fe97 100644 --- a/blockset-lib/src/secp256k1/scalar.rs +++ b/blockset-lib/src/secp256k1/scalar.rs @@ -14,11 +14,6 @@ const fn is_valid_private_key(key: U256) -> bool { pub type Scalar = Field<0xFFFFFFFF_FFFFFFFF_FFFFFFFE_FFFFFC2F, 0xFFFFFFFF_FFFFFFFF_FFFFFFFF_FFFFFFFF>; -// pub const N: U256 = [ -// 0xBAAEDCE6_AF48A03B_BFD25E8C_D0364141, -// 0xFFFFFFFF_FFFFFFFF_FFFFFFFF_FFFFFFFE, -//]; - impl Scalar { pub const _2: Self = Self::n(2); pub const _3: Self = Self::n(3);