Skip to content

Commit

Permalink
scalar
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-shandar committed Jul 31, 2024
1 parent 8bea2ab commit 3bb14e7
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 15 deletions.
4 changes: 0 additions & 4 deletions blockset-lib/src/secp256k1/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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]
Expand Down
7 changes: 2 additions & 5 deletions blockset-lib/src/secp256k1/nonce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion blockset-lib/src/secp256k1/point.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use core::panic;

use crate::uint::u256x::{self, U256};
use crate::uint::u256x;

use super::{scalar::Scalar, Order};

Expand Down
5 changes: 0 additions & 5 deletions blockset-lib/src/secp256k1/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3bb14e7

Please sign in to comment.