Skip to content

Commit

Permalink
One more test
Browse files Browse the repository at this point in the history
  • Loading branch information
gogo2464 committed Dec 9, 2023
1 parent e3a4bd9 commit 41a2830
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions cryptatools-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pub mod cryptography;
pub mod utils;
pub mod maths;

use crate::maths::ECC;

Check warning on line 6 in cryptatools-core/src/lib.rs

View workflow job for this annotation

GitHub Actions / test (windows-latest)

unused import: `crate::maths::ECC`

Check warning on line 6 in cryptatools-core/src/lib.rs

View workflow job for this annotation

GitHub Actions / test (windows-latest)

unused import: `crate::maths::ECC`

Check warning on line 6 in cryptatools-core/src/lib.rs

View workflow job for this annotation

GitHub Actions / test (windows-latest)

unused import: `crate::maths::ECC`

Check warning on line 6 in cryptatools-core/src/lib.rs

View workflow job for this annotation

GitHub Actions / test (windows-latest)

unused import: `crate::maths::ECC`

Check warning on line 6 in cryptatools-core/src/lib.rs

View workflow job for this annotation

GitHub Actions / test (windows-latest)

unused import: `crate::maths::ECC`

Check warning on line 6 in cryptatools-core/src/lib.rs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

unused import: `crate::maths::ECC`

Check warning on line 6 in cryptatools-core/src/lib.rs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

unused import: `crate::maths::ECC`

Check warning on line 6 in cryptatools-core/src/lib.rs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

unused import: `crate::maths::ECC`

Check warning on line 6 in cryptatools-core/src/lib.rs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

unused import: `crate::maths::ECC`

Check warning on line 6 in cryptatools-core/src/lib.rs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

unused import: `crate::maths::ECC`

Check warning on line 6 in cryptatools-core/src/lib.rs

View workflow job for this annotation

GitHub Actions / test (macos-latest)

unused import: `crate::maths::ECC`

Check warning on line 6 in cryptatools-core/src/lib.rs

View workflow job for this annotation

GitHub Actions / test (macos-latest)

unused import: `crate::maths::ECC`

Check warning on line 6 in cryptatools-core/src/lib.rs

View workflow job for this annotation

GitHub Actions / test (macos-latest)

unused import: `crate::maths::ECC`

Check warning on line 6 in cryptatools-core/src/lib.rs

View workflow job for this annotation

GitHub Actions / test (macos-latest)

unused import: `crate::maths::ECC`

Check warning on line 6 in cryptatools-core/src/lib.rs

View workflow job for this annotation

GitHub Actions / test (macos-latest)

unused import: `crate::maths::ECC`
use crate::utils::alphabets::{Encoding, Alphabet, split_bytes_by_characters_representation, uniffy_opcode_group};
use crate::cryptography::classical::encryption::monoalphabetic_ciphers::caesar_number::CaesarNumberAlgorithm;
use crate::cryptography::classical::encryption::transpositional_ciphers::columnar_transposition::ColumnarTranspositionAlgorithm;
Expand Down
10 changes: 4 additions & 6 deletions cryptatools-core/src/maths/ECC.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,7 @@ impl Point {
///
pub fn double(&self) -> Point {
let u = BigInt::from(&self.x_cord + &self.z_cord).pow(2 as u32);
println!("test");
let v = BigInt::from(&self.x_cord - &self.z_cord).pow(2 as u32);
println!("test2");
let diff = BigInt::from(u.clone() - v.clone());
let x_cord = (u * &v) % &self.modulus;
let z_cord = ((v + &self.a_24 * &diff) * diff) % &self.modulus;
Expand Down Expand Up @@ -157,8 +155,6 @@ impl Point {
/// assert_eq!(p3.x_cord, BigInt::from(23));
/// assert_eq!(p3.z_cord, BigInt::from(17));
/// ```


pub fn mont_ladder(&self, k: &BigInt) -> Point {
let mut q = self.clone();
let mut r = self.double();
Expand Down Expand Up @@ -398,11 +394,13 @@ fn optimal_b1(digits: usize) -> usize {
///
/// use cryptatools_core::maths::ECC::*;
///
/// // assert_eq!(BigInt::from_str("398883434337287"), );
///
/// assert_eq!(
/// ecm(&BigInt::from_str("398883434337287").unwrap()).unwrap(),
/// HashMap::from([
/// (BigInt::from(99476569), 1),
/// (BigInt::from(4009823), 1),
/// (BigInt::from_str("99476569").unwrap(), 1),
/// (BigInt::from_str("4009823").unwrap(), 1),
/// ])
/// );
/// ```
Expand Down

0 comments on commit 41a2830

Please sign in to comment.