Skip to content

Commit

Permalink
Mul (#180)
Browse files Browse the repository at this point in the history
* mul

* mul128

* fmt

* tests

* x

* fmt

* cargo fmt

* x

* u256

* mul test

* test

* mul

* mul

* x

* z

* q

* x

* q

* q

* test

* q

* x

* w

* x

* q

* x

* U256

* x as a suffix

* wadd, oadd, osub

* borrow

* U256::sub

* u256::wsub, u512::wsub

* broken div_rem

* U512

* division

* test

* shl bug fix

* shl

* div_rem

* ok

* secp256k1

* add

* failing.

* fix for u128::mul

* fix u256::mul bug

* one

* minor

* fmt

* u256x::div_rem

* reciprocal

* reciprocal

* algo

* sqr

* fmt

* result

* fix a name: sqr => sqrt

* is_neg and abs

* abs

* y2() and y()

* N

* point

* point

* point

* remove check

* remove check

* G

* fmt

* field

* P0, P1

* Order type

* verify

* f

* SHA256

* HMAC

* ok

* state

* hmac

* no k

* hmac

* sha

* hmac

* 0

* 01

* len fix

* 01234567

* ab

* fmt

* d

* 65

* 6A

* 6A

* 6B

* n

* hash state

* sha

* Be (#181)

* be

* ok

* u256x::be

* fix

* test

* HMAC

* HMAC

* HMAC-SHA256

* BeChunk

* BeChunk

* chain

* nonce

* nonce

* test

* test

* SHL

* fmt

* swap32

* test

* nonce

* nonce assert

* test

* s()

* c

* mod

* v

* scalar

* Prime

* 3

* curve

* x

* mod

* secp256k1p

* Order

* Order

* Order

* field/prime.rs

* prime_field

* prime field

* Elliptic_curve

* nonce

* vec2

* lib

* lib

* prime_field

* secp256k1

* p192r1

* P192R1

* 192

* 3^122

* double

* return

* fix double

* U

* nonce

* nonce

* point_check

* 192

* P224r1

* 256r1

* p256r1

* verify

* issues

* asn.1

* ASN.1

* ASN.1

* asn.1

* write_int

* ASN.1

* int deserialize

* result

* longForm len

* ASN.1

* broken

* ASN.1

* ASN.1

* broken

* dyn

* tests

* dependencies update

* ok

* fmt

* wasm32-wasp2

* target

* div_ceil

* p

* scalar

* 95
  • Loading branch information
sergey-shandar authored Jan 26, 2025
1 parent 0437a13 commit cdebe0b
Show file tree
Hide file tree
Showing 56 changed files with 3,672 additions and 419 deletions.
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[alias]
t = "test --release"
c = "tarpaulin --out html --release --lib --fail-under 99"
c = "tarpaulin --out html --release --lib --fail-under 95"
n = "nextest run --release"
l = "llvm-cov --html"
122 changes: 61 additions & 61 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
name: Rust

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always

jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cargo fmt -- --check

clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cargo clippy -- -D warnings

run-wasmtime:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@wasmtime
- run: rustup target add wasm32-wasi
- run: cargo build --target wasm32-wasi --release
- run: wasmtime ./target/wasm32-wasi/release/blockset.wasm validate c02hb4h8s6v05pxpnhcyxdebewfbwbrg6sp3k46hsh6qc

test-wasm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@wasm-pack
- run: wasm-pack test --node --release ./blockset-lib

test:
strategy:
matrix:
# https://docs.github.com/en/actions/using-jobs/choosing-the-runner-for-a-job#choosing-github-hosted-runners
os: [windows-latest, ubuntu-latest, macos-14]
type: ['', '--release']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- run: cargo test ${{ matrix.type }}

coverage:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@cargo-tarpaulin
- run: cargo c
- uses: actions/upload-artifact@v3
with:
path: tarpaulin-report.html
if: always()
name: Rust

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always

jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cargo fmt -- --check

clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cargo clippy -- -D warnings

run-wasmtime:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@wasmtime
- run: rustup target add wasm32-wasip2
- run: cargo build --target wasm32-wasip2 --release
- run: wasmtime ./target/wasm32-wasip2/release/blockset.wasm validate c02hb4h8s6v05pxpnhcyxdebewfbwbrg6sp3k46hsh6qc

test-wasm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@wasm-pack
- run: wasm-pack test --node --release ./blockset-lib

test:
strategy:
matrix:
# https://docs.github.com/en/actions/using-jobs/choosing-the-runner-for-a-job#choosing-github-hosted-runners
os: [windows-latest, ubuntu-latest, macos-14]
type: ['', '--release']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- run: cargo test ${{ matrix.type }}

coverage:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@cargo-tarpaulin
- run: cargo c
- uses: actions/upload-artifact@v3
with:
path: tarpaulin-report.html
if: always()
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ blockset-lib = { path = "blockset-lib", version = "0.7.0" }
io-trait = "0.11.0"
io-impl = "0.11.0"
io-test = "0.11.0"
wasm-bindgen-test = "0.3.42"
nanvm-lib = "0.1.0"
wasm-bindgen-test = "0.3.50"
nanvm-lib = "=0.1.0"
2 changes: 1 addition & 1 deletion blockset-lib/src/app/get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{
cdt::node_type::NodeType,
common::status_line::{mb, StatusLine},
forest::{file::FileForest, node_id::ForestNodeId, Forest},
uint::u224::U224,
uint::u224x::U224,
};

use super::{
Expand Down
4 changes: 2 additions & 2 deletions blockset-lib/src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use crate::{
},
forest::{file::FileForest, tree_add::ForestTreeAdd},
info::calculate_total,
uint::u224::U224,
uint::u224x::U224,
};

fn set_progress(
Expand Down Expand Up @@ -170,7 +170,7 @@ mod test {
use std::io::Write;
use wasm_bindgen_test::wasm_bindgen_test;

use crate::{cdt::node_id::root, common::base32::ToBase32, run, uint::u256::U256};
use crate::{cdt::node_id::root, common::base32::ToBase32, run, uint::u256x::U256};

#[wasm_bindgen_test]
#[test]
Expand Down
Loading

0 comments on commit cdebe0b

Please sign in to comment.